NYCPHP Meetup

NYPHP.org

[nycphp-talk] foreach ERROR

Allen Shaw ashaw at polymerdb.org
Tue Jul 18 23:14:14 EDT 2006


Ed,

Did you try var_dump($sort) to see what's in $sort?  Seems clear that 
php doesn't like $sort, and a var_dump might tell you why.

- Allen

CED wrote:
> It's almost like it doesn't like the $sort being passed to it... hmmm
> 
> 
> ----- Original Message ----- 
> From: "CED" <Consult at CovenantEDesign.com>
> To: "NYPHP Talk" <talk at lists.nyphp.org>
> Sent: Tuesday, July 18, 2006 8:00 PM
> Subject: Re: [nycphp-talk] foreach ERROR
> 
> 
> This is the most recent, and stripped down, state:
> 
> <?
> $dir = '../Audio/Music';
> foreach(glob("$dir/*.mp3") as $item){$sort[] = (end(explode('/',$item)));}
>     foreach($sort as $item){$return[]= $item;}
>      if(!$return){return array();}
> 
>   echo($return[0]) ;
>   ?>
> 
> 
> And this is still the error:
> 
> Warning: Invalid argument supplied for foreach() in
> /hsphere/local/home/skoilnog/edwardprevost.info/Audio/mp3/Audio.php on line
> 4
> 
> I Am Completely Baffled.
> 
> -Ed
> 
> 
> 
> ----- Original Message ----- 
> From: "Ken Robinson" <kenrbnsn at rbnsn.com>
> To: "NYPHP Talk" <talk at lists.nyphp.org>
> Sent: Tuesday, July 18, 2006 7:37 PM
> Subject: Re: [nycphp-talk] foreach ERROR
> 
> 
> At 07:27 PM 7/18/2006, CED wrote:
> 
>>Rob,
>>
>>I placed that iteration areound the last portion of the function, still no
>>worky.
>>
>>Code errors on Line 23 now..
>>
>>foreach(readd($sFolder) as $item)
> 
> 
> 
> 
>   Can you post the current non-working script? With so many different
> suggestions, I'd like to be able to see what you're seeing.
> 
> Ken
> 
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
> 
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
> 
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
> 
> 
> 
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
> 
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
> 
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
> 
> 
> 
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
> 
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
> 
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
> 


-- 
Allen Shaw
Polymer (http://polymerdb.org)



More information about the talk mailing list