[thelist] Weird PHP parse error

Beau Hartshorne beau at members.evolt.org
Fri Nov 22 14:55:00 CST 2002


> Can anyone tell me why PHP would report a parse error on the second
line of
> this SIMPLE loop?
>
> for($i=0;$i<=$u;$i++) {
> 	echo "yeah";
> }

I don't get a parse error, I get a couple notices. The notices appear
because you have not assigned a value to the variable $u.

Try this:

<?php

$u = 5;

for($i=0;$i<=$u;$i++) {
	echo "yeah";
}

?>

Beau





More information about the thelist mailing list