Skip to content
Advertisement

php-echo doesn’t stop after semicolon

this is a noob question.A very big noob question. I’m trying echo something,using notepad++ to code.

<!DOCTPYE html>
<html>
<body>
<?php
echo "<h2>PHP is fun!</h2>";
echo "Hello world!<br>";
echo "I'm about to learn PHP!<br>";
echo "This", " string", " was", " made", " with multiple parameters.";
?>
</body>
</html>

But what I get is this:

PHP is fun!"; echo "Hello world!

"; echo "I'm about to learn PHP!

"; echo "This", " string", " was", " made", " with multiple parameters."; ?>

What am I doing wrong?

Advertisement

Answer

You are getting this result because you are running from Notepad++ Run -> Launch in Browser.

This is wrong. Use any web server to make it work. It will not just started working by merely launching the page in browser.

For basic start you can try Wamp Server.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement