This forum is now read-only. Please use our new forums! Go to forums
4/7 Parse error: syntax error, unexpected T_ENDWHILE, expecting ',' or ';'
Using Endwhile
Here is my PHP code
<!DOCTYPE html>
<html>
<head>
<title>A loop of your own</title>
<link type='text/css' rel='stylesheet' href='style.css'/>
</head>
<body>
<?php
$loopcount = 10 ;
while ($loopcount <= 100):
$loopcount + $loopcount + 10;
echo "<p> $loopcount is too small,unless the value is 100</p>"
endwhile;
echo "<p> it is 100 now.</p>";
?>
</body>
</html>
Why I will get “Parse error: syntax error, unexpected T_ENDWHILE, expecting ‘,’ or ‘;’ on line 13 “
Answer 52bca87d52f86348ca000a47
1 vote
It’s expecting a ‘;’ after echo “ $loopcount is too small,unless the value is 100” And right above that, I think you meant to write $loopcount = $loopcount + 10;
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency
2 comments
thanks for your help :)
You’re Welcome :)