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]
|