Changing the code from an array to single value
I have the following code:
<?php
$cts = array('tv', 'movie', 'game', 'music', 'application', 'anime');
$z = 1;
foreach($cts as $c) {
echo '<div class="boxindex">
<div class="cathead" id="c'.substr($c, 0, 2).'">
<h2><a href="'.print_category_link($c, 'latest').'"><span>'.ucfirst($c).'
stuff</span></a></h2>
</div> <!-- EOF div:'.substr($c, 0, 2).' -->
<div class="box pad">
<div class="innards">
<table class="list">';
latest($$c, $c);
echo '
</table>
<p><a href="'._domain.'/rss/'.$c.'" style="text-decoration:none"><img
src="'._domain.'/images/rss_orange.png" width="16"
style="vertical-align:middle" alt="Latest '.ucfirst($c).' Feed" /> Latest
'.ucfirst($c).' Feed</a></p>
</div>
</div> <!-- EOF div:box pad -->
</div>';
if($z%2 == 0)
echo '<div class="clear"></div>';
$z++;
}
?>
Here is the problem:
I not being able to change this code to print just one category. I need
the 'tv' results and not the full array because i will put on other
section/button the others results separatly. What should i be doing? This
code is not mine and i dont understand php very much. Thanks
No comments:
Post a Comment