Reply to Re: Variable scope issue

Your name:

Reply:


Posted by Chung Leong on 06/01/06 18:13

Oli Filth wrote:
> rlee0001 said the following on 01/06/2006 18:31:
> > This is seriously blowing my mind.
> >
> > $a = array('a', 'b', 'c');
> > for ($i=0; $i<=count($a); $i++) {
> > echo 'In FOR: '.$a[0].' - '.$a[1].' - '.$a[2]."\n";
> > if ($a[$i] = 'a') {
> > echo 'In IF: '.$a[0].' - '.$a[1].' - '.$a[2]."\n";
> > }
> > }
> >
>
> "==" vs. "="...
>
>
> --
> Oli

That doesn't explain the problem he/she described. As written, the code
would loop forever, since a new row is added at the end whenever $i ==
count($a).

Obviously we can't diagnose code with typos...

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация