This forum is now read-only. Please use our new forums at discuss.codecademy.com.

While Loops in PHP Forum

View Course » View Exercise

67 points
565d7d2e51b887ffd90006fd_883637432
Submitted by
Nelson Malath
over 3 years ago

Regarding $headCount Variable

Just after <?php syntax, the variable $headCount has been assigned a definite value, i.e. 0.
Then why is while ($headCount < 3)is mentioned? The value of the variable is mentioned at the time of defining the variable, then how can it's value change over time?


0 votes

permalink

Hi Nelson,

I would need to see the code to know what's going on, but I have a feeling there's something like $headCount++ at the end of the do {...} section of the code.

2819 points
5674c6dae39efec455000434_879409444
Submitted by
Zeke Y
almost 3 years ago