What is PHP(Hypertext Preprocessor)?
PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
It is Competitor of Microsoft’s ASP.
And It is the core of “WordPress”.
and yes it is Open Source language.
basically scripts are executed on server.
How to work with PHP?
We will be scripting with the help of “WampServer“.
so first step is to install wamp on your computer.Not going to describe how to install. This you should know 🙂 .
First PHP Script.
So, After you installed wamp on your drive go to the www folder and then open text editor (like notepad) and paste the code as below:
echo “<p>My first PHP script!</p>”;
Now save it with .php file and open in your browser.
So, basically this runs on your local server and return you as a plain HTML. you can see that with “view page source” in your browser
you can not open .php file directly to your browser it will not understand echo and all other syntax.
Wait what is <? and ?> .
A PHP script starts with <?php and ends with ?>
Ok now Echo.
Echo basically print the statement written within ” “ and remember statements ends with ; (semicolon).