I have a question which I don't know the answer of. I've been thinking about it for a while.
The following code:
$i = 1;
while($i < 10)
if(($i++) % 2 == 0)
echo $i;
It correctly outputs 3579, but why isnt 1 also included in the output?
I'm a beginner with PHP and am looking forward for someone to help me.
Thank you very much! :D
echo $1;TYPO maybeecho $i;would work better$iAFTER you test it, not beforewhy isnt 1 also included in the output?because you are incrementing iti++so it becomes 2. use$i=0;at the start