Introduction to PHP - What is PHP and Why Do I Need it?

Guest Posts Paolo Nikko Nuñal

For those of you who are starting to learn web programming it is essential that you also know how to manipulate data using PHP. You might ask what is PHP? For starters it is an acronym for "Hypertext Preprocessor". PHP is a general-purpose scripting language that is designed for web development and can be embedded into HTML.

Code:

<html>
  <head>
     <title>My Title</title>
  </head>
  <body>
      <?php
          echo " Hello World";
      <?
  </body>
</html>


From the code above, you can see that the PHP, file is actually embedded on the HTML elements. What the script does, is actually printing the word "Hello World".

When you start writing a PHP script, you need to start with a <?php and end it with ?>. That will allow you to get in or out of PHP coding.

What makes PHP different from JavaScript is the fact it is run on the server rather on the client-side. The client would receive the results of the running script, but will not know what the code actually does. You can also configure your web server to process or manipulate your HTML files with PHP, and your users will not know anything about it.

PHP development is more focused on the server-side scripting, and you can do more about it.

However, you need to have a server running on the background for PHP to run. We suggest you get WAMP or XAMP for Windows, LAMP for Linus and MAMP for Mac users. This is a complete application combined with database, server, and Apache.