Learn PHP from Scratch Day -2

Learn PHP from Scratch Day -2
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.

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

echo "Hello world..!";
?>

Output:

Hello world..!

Summary

  • 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 is open source and cross platform , under MIT license.