Now a days PHP is one of the most popular server side scripting language, used to make dynamic websites, PHP started with a small personal project but now a days people found it very useful to make large projects like youtube.com, favebook.com etc.
* the full name of PHP is PHP: Hypertext Preprocessor
* PHP is a server side scripting language which is embedded with html.
* PHP supports a number of database system like mysql which is inbuilt with wamp and xampp, sql etc.
* PHP supports many protocols like POP3, IMAP, and LDAP.
* PHP 5 and above supports object oriented programming.
* PHP syntax is similar with C.
Writing Style of PHP code.
php code must be written inside a particular tag as it is embedded with html. I am showing here the most popular types or process of writing php scripting code.
* the default way to write php script is open with <?php tah and close with ?> tag and inside that write php code.
* another way to write php code is open and close with <? and ?> , that is the different with upper one is just remove the text php but for local have to setup.
* there is another way also to write php script its like as java-script code. and the opening and closing tag is, <script language = “php”> and </script>
an example is given below.
<?php Write PHP code here ?> <? Write PHP code here ?> <script language = "php"> PHP code should be written here </script>
What we can do using PHP?
using php we can perform several tasks, but in front end we can only show html or image or pdf. but the server side opportunities are as described below,
* we can create, add, edit, delete files in server side.
* from server side we can generate dynamic content.
* we can collect form data which is submitted and use that.
* we can save and collect session and cookies.
* we can be able to restricted user interface.
* can be able to make encrypted data , one way encryption also
* we can perform database interface.
Why should we use PHP?
* the first one is PHP is open source.
* there is a lot of tutorial available in internet.
* its supports multiple platform
* nearly all server provides php as pre installed.
* php supports multiple numbers of database.
Make your first program by printing Hello World! using php.
Below there is a code given on how to print a hello world! text using php it should be your first programming written in php.
<!DOCTYPE html> <html> <head> <title>First PHP Program</title> </head> <body> <?php echo "Hello World!"; ?> </body> </html>
I hope it will help you to understand why should we use php as a programming language to make a dynamic website.
Thanks for reading.