Interesting For Loop =))
Posted: Fri Sep 02, 2011 8:09 am
hey guys, i have this intriguing code that really amazed me, anyway i'm just a months old in learning php and probably you all guys can understand my post heheheh,
here's the code
actually i've been trying to figure it out, i also break it down, using the basic loop, and put inside the loop "echo $x+=2 == (++$n) % 2", because in my understanding if the condition become true, it will put a new value in var $x, but it doesn't seems right, it continue printing 1-99,
can someone help me through out of this
,
Thank you so much in advance =)
here's the code
Code: Select all
$x=0;
$n=0;
for(;$x+=11==(++$n.$n)%22,$n<100;)
echo"N=$n,A=$x";
can someone help me through out of this
Thank you so much in advance =)