PHP Hello World Example

You start all PHP scripts with the <?php open tag and end the tag after your code with ?> .

As shown here PHP can be embedded into HTML or you can have a file that has only php in it.

In either case, the file must have the extension php (i.e. helloworld.php ) and must be installed on a server that supports PHP (has installed a PHP server on it).

<html> 
 <head>
 <title>Hello, PHP</title>  
 </head>
<body bgcolor="#EFEFFF">  <p>

<?php  print "Hello, World!";  /* Notice the <?php ?> escape brackets. */  

?>  


</body>
</html>  


Try it out now
© Lynne Grewe