Re: foreach problem part two [message #184283 is a reply to message #184279] |
Fri, 20 December 2013 03:11 |
Doug Miller
Messages: 171 Registered: August 2011
Karma:
|
Senior Member |
|
|
richard <noreply(at)example(dot)com> wrote in news:y1yigdragnyw$.c2kv48q50osj.dlg@
40tude.net:
> On Thu, 19 Dec 2013 22:34:24 +0000 (UTC), Doug Miller wrote:
>
>> richard <noreply(at)example(dot)com> wrote in news:oib4w8z2sr5y$.15xxzxjds0xb0$.dlg@
>> 40tude.net:
>>
>>> <?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?
>>
>> Because you don't understand how foreach() works. RTFM.
>
> I did.
Then read it again, because you obviously didn't understand it first time through.
> There is a flaw in the works that is not discussed.
No, there isn't. The only flaw here is your failure to understand the way foreach() works.
RTFM.
> That being, it won't work with brackted arrays.
That's *not* where the problem is in your code. RTFM.
|
|
|