Learn PHP From Scratch Day 2

Today We are going to see some basics of PHP. What is PHP & we write our first PHP program.

What is PHP?

PHP is a server side scripting language. that is used to develop websites or Web applications. PHP stands for Hypertext Pre-processor, that earlier called as Personal Home Pages.

This definition is just definition, That just for you to as like we have habit to have definition of terms. But knowing definition not means you know PHP.
So let’s dive into deep in the ocean of PHP.

Some Points You Must remember.
1) PHP file have *.php extension other extensions are also there that supports php code are

  • .phtml
  • .php3
  • .php4
  • .php5
  • .phps

but now everywhere *.php is used.

2) You need some server that Parse the PHP in to hypertext(HTML) and send it to Browser , as we already seen in lecture 1, the Browser only knows HTML,CSS,JS languages . So do you want the proof , just try to open *.php file in browser without using any server, just like as if you open image in browser. What you will see the code as it is..!
But this code is not executed. So what we need that make our life simple..? Yeah it’s server we need. Here we use Apache Server that do the parsing task.

3) In order for the this server to identify the PHP code from the HTML code, we must always enclose the PHP code in PHP tags.

<?php …. ?>

<?php is opening tag.

?> is closing tag. The php code statements are written between these opening & closing tag.

4) PHP is a case sensitive language, “ABC” is not the same as “abc”. But

<?php is not case sensitive you can still write opening tag as <?PHP but it is strongly recommended that you use <?php

PHP statements closed with a semi colon (;). If you only have one statement, you can skip the semi colon. If you have more than one statement, then you must end each statement with a semi colon. PHP scripts are executed on server that renders it in form of HTML.

4) If you are interested in running php code on your local machine you need XAMPP. You can download XAMPP from https://www.apachefriends.org/download.html

PHP Hello world

This is our first simple program which shows us Hello world..! text on browser.

echo "Hello world..!";


Hello world..!


  • PHP stands for Hypertext pre-processor
  • PHP is a server side scripting language. This means that it is executed on the server.
  • Your Clients don’t need to have server to interpret the PHP code, it’s done by our server (mostly Apache for PHP) and it outputs in the HTML form that is understood by clients browser.
  • PHP files are saved with the “.php” file extension, and the PHP development code is enclosed in tags. <?php ?>
  • PHP is open source and cross platform , under MIT license.

Leave a Comment

Your email address will not be published. Required fields are marked *