I’m begin to learn php by my self, for example I have this code,suppose to disply “Hello World”
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo '<p>Hello World</p>'; ?>
</body>
</html>
I save it as hello.php, but when I open it by Firefox it display like that:
Hello World
'; ?>
can somebody explain for me?
Congratulations on getting started with php.
You will need a web server to run PHP. Firefox can process HTML, CSS and Javascript markup/codes to output the web page but it can’t process. It’s a server side language and you will need some sort of server to do that.
If you have a Windows PC, the easiest way, at least for me, would be XAMPP/WAMP or similar software. You can find a good comparison chart in Wikipedia.
You can make the code clean with following syntax.
looks neat I think 🙂