While loop syntax error


#1

I can't finish "While loops in PHP" because of Parse error: syntax error, unexpected ')' on line 9
As for me - I've made a correct code.




Your First PHP while loop!


<?php
$loopCond = true;
while($loopCond == true) {
//Echo your message that the loop is running below
echo "

The loop is running.

";
}
echo "

And now it's done.

";
?>


#2

PHP will recognize the truthy value, $loopCond.

while ($loopCond) {
    // code
    $loopCond = false;
}

Remember to change the value inside the loop or it will run forever.


#3

I tried even a hint, but syntax error is still there.


#4

Once we've seen it, we can't unsee it. My answer condradicts the example, but is no less pertinent. It's as well this course is sunsetting. So many questions arose that should never have.


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.