+ 1
PHP Problem
I created a new web code to use my newly learned PHP skills, and I was testing something out: <?php for($a = 1; $a <= 100; $a++){ echo("<p>Jeff</p>"); } ?> This resulted in the following: Jeff );}? The last line I am not sure if it printed exactly that, but it is usually below the echo line. •I have tried doing the echo with no parentheses But when I ran it with the PHP code, it printed Jeff 100 times(like it is supposed to), what is the problem?
2 Réponses
+ 1
i guess your page extension is ".html" (f.e. mypage.html)
if that is the case, change it to ".php" (f.e. mypage.php) and you shouldn't see the additional );}? charachters.
that should be a security feature of servers.
https://stackoverflow.com/questions/16995177/when-would-i-want-to-use-html-vs-php-as-a-file-extension
0
echo doesn’t use parentheses, most of the time, there are exceptions.
If you want to use them use print() instead of echo.