Parse error: syntax error, unexpected T_ELSE on line 15


Although it says i passed i am getting and error syntax please help


Can you paste your code in this format

  replace this line with your code, leave backticks


remove the semicolon on line 14
and in php you cannot have an else without an if


   $practice = 0;
        //write your do-while loop below
        do {
            if ($practice < 100)
            echo "<p>True </p>";
      while ($practice > 10);{
      echo "<p>False</p>";

i re wrote the code



Remember there should be a curly bracket { after your condition so the } doesn't close anything.

Remove the semicolon.


Simplest do/while

    $practice = 0;

    do {
    echo "False";

while ($practice > 10);


While checks if $practice is greater than 10, it's not, the loop ends and echos do.


Your code isn't good. Remember a while loop structure looks like this:

while(condition) {
//We execute the code in the curly brackets, watch out for infinite loop!


it's a do while chk, if $practice is more than 10, we'll get an infinite loop. that simple code works and passes through. my initial code is more complex for my course, this was a quick thing to show how do/while chks and work.


where does that happen?


run the script, you should get whatever is asked to echo in the do.


in reference to the statement. it sounds like you were saying do is echoed and not the statements inside do


without the if and else statements? no


Wait where does he echoed do?


@miniapple8888 i was just addressing the fact that @codelazy's statement here

needs to rephrased because i think what he wanted to write was that the content of the do block is executed


thank you
you guys are the pros, not me :- )
thats the best i could do with the original code without the ifs and else statements.
And in trying to make that work i lost my own course code haha