What's wrong in this code: | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What's wrong in this code:

<html> <head> </head> <body> <script language="php"> <?php $x = 1; do{ $x++; } while($x<10); ?> </script> </body> </html>

26th Jul 2018, 12:47 AM
Raihan Akram
Raihan Akram - avatar
2 Answers
+ 8
You didn't print anything within the loop, so there's no output. Also, if you are already enclosing your PHP code within <?php ?>, there is no need to declare the script tag.
26th Jul 2018, 1:02 AM
Hatsy Rei
Hatsy Rei - avatar
+ 2
ok thanks! actually i am a beginner in php...just started learning today... thanks for your help:)
26th Jul 2018, 1:59 AM
Raihan Akram
Raihan Akram - avatar