Home > Articles > Programming > PHP

  • Print
  • + Share This
From the author of

Step 3: Writing your first few lines of PHP code

In the grand tradition of running server-side code, you now have two more steps to perform before you can run your first piece of PHP code:

  • Write some code.
  • Place that code in a specific location.

Let's get the first step out of the way and create a file called hello.php. You can just copy the code in Listing 1. When you create the file, make certain that it has the .php filename extension.

Listing 1 Hello World from PHP

<html>
 <head>
 <title>PHP Test</title>
 </head>
 <body>
 <?php echo ’<p>Hello World</p>’; ?> 
 </body>
</html>

The Hello World file has to be copied into the www directory in the folder into which EasyPHP was installed.

You're just about there now! Let's run the code.

  • + Share This
  • 🔖 Save To Your Account