What is PHP?
- PHP stands for “PHP Hypertext Preprocessor”. Originally created by Rasmus Lerdorf in 1994.
- PHP is a server-side scripting language mainly developed for web development purpose but this can also be used as a general-purpose programming language.
- PHP code can be embedded into HTML script and it can also be used in combination with various open source web applications and other frameworks.
- PHP code is processed by a PHP interpreter which is implemented as a module in the web server. And the web server combines all the results of the interpreted PHP code, which can be any type of data like images, text etc.
- The PHP interpreter, powered by the Zend Engine and this is also a free software released under the PHP License.
- PHP can be used on all operating systems like Linux, HP-UX, Solaris and OpenBSD, MS Windows, Mac OS X, RISC OS etc.
- PHP also supports most of the web serverslike Apache, IIS, and others.
- One of the strongest feature in PHP is to a wide range of databases.
Basic uses of PHP:
- You can generate dynamic web pages using PHP language
- You can set Cookies and Sessions using PHP and also you can receive the values of cookies and sessions for adding some conditions of web pages.
- You can receive PHP forms values easily using GET and POST methods
- You can add/edit/delete values directly from databases using PHP language after creating a database connection.
- You can also encrypt data using PHP functions.
- You can also create, open, read, write, delete, and close files directly on the server.
Write “My First Program in PHP” Script using PHP5:
Let us now start with the very basic PHP script which will just print the word “My First Program in PHP”
<title>My First Program in PHP</title>
<?php echo "My First Program in PHP";?>