fixed! (was: foreach problem part two) [message #184277 is a reply to message #184268] |
Thu, 19 December 2013 21:07 |
Mr Oldies
Messages: 241 Registered: October 2013
Karma:
|
Senior Member |
|
|
On Thu, 19 Dec 2013 13:41:51 -0500, richard wrote:
> <?php
> foreach ($aname as $item){
> echo $aname[$item][1];
> echo " (".$aname[$item][2].")";
> }
> ?>
>
> I decided to create a second array that holds only the artist and number of
> records.
> So why am I getting "invalid argument" with this?
<?php
$result=count($art60);
$acount=0;
while ($acount<=$result){
echo "<div class='blu'>";
$number=count($art60[$acount]);
echo $art60[$acount][0];
echo " (".$number.")";
echo "</div>";
$acount++;
}
?>
This version not only shows the names, but the number of songs each
produced as well.
http://mroldies.net/artists/60artists.php
|
|
|