Hi, my code isnt working


#1

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

The Code is running

";
$loopCond = false;
}	
echo "And now it's done.";
?>

#2

What error message are you getting (if this is still a problem)? Could it be as simple as,

if ($loopCond) {
    echo "The code is running...";
    $loopCond = false;
}
echo "And now it's done.";

#3

A post was split to a new topic: Stuck in this 6.lesson


#4

<?php
$loopCond = true;
while ($loopCond == true){
    //Echo your message that the loop is running below
    echo "the loop is running";
    $loopCond = false;
}
echo "<p>And now it's done.</p>";
?>

i am stuck here despite I do get the right output but still can not go to the next step and gives me the below error.

(( Oops, try again. expected p:first-child text to be equal to The loop is running. but got And now it's done. ))

can someone please help me with this ???


#5

The SCT is looking for a P-node...

    echo "<p>The loop is running</p>";

#6

I tried this as well but still gives me the same error.


#7

Could you paste your entire HTML into,

```

here

```

please?


#8
<?php
$loopCond = true;


while ($loopCond == true) {
    echo"<p> The loop is running.</p>";
	
	$loopCond = false;
}
echo "<p>And now it's done.</p>";
?>

this is my code..... the error is like Oops, try again. expected p:first-child text to be equal to The loop is running. but got The loop is running.


#9

oh I resolved the issue....

the problem was that I declared $loopCond == true two times.
I only put $loopCond in while bracket which was already declared to true outside the function.

I will thank you as well for trying to help me.


#10

A post was split to a new topic: The output is OK But it is suggesting me some semicolons