PHP (Hypertext Preprocessor)
What is PHP?
PHP is acronym for Hypertext Preprocessor which was initially known as Personal Home Page. PHP is open source software and server side general purpose scripting language which was designed for web development to create dynamic web pages. PHP scripts are executed on server. It is free to download and use. PHP is easy to learn for any newcomer.
PHP can be easily embedded with HTML (Hypertext Markup Language) source code. PHP can be used to create image, PDF file, Flash files using libraries, text files, XML, CSV and many more.
PHP is platform independent and can be easily installed or configured on any operating system like Linux, MAC, Microsoft Windows, Solaris. PHP supports most of the web servers like Apache, Microsoft Internet Information Server and more.
PHP supports most of the databases like MySql, Oracle, SQLite, PostgreSQL etc. MySql is majorly used database for development. PHP also support command line interface where we can develop shell applications.
PHP can communicate with number of protocols like HTTP, FTP, SNMP, LDAP, SOAP, POP3 and more. PHP also allows extensions like DOM API, COM etc.
PHP has configuration file named as php.ini. Configuration file is read only once when web server is started.
History of PHP
PHP was created by Rasmus Lerdorf in 1995. Initially Rasmus wrote a simple Perl script to track his resume online, so PHP syntax, variable declaration is much same as of Perl. He named this simple Perl script as Personal Home Page
<?php ?>. We can also use
<script language="php"> </script>, short tags like
<?= ?> . We can use ASP tags too. We can set tags configuration in php.ini file. Every PHP instruction should be terminated by semicolon(;). To comment any PHP instruction, we can used three different ways. To comment single line PHP instruction we can use
// characters. To comment block of PHP code we can use
/* --- */.
PHP Language Reference
- PHP support data types like booleans, integers, float, strings, array, objects etc.
- PHP variable is represented by dollar($) sign and variable name.
- PHP supports control structures like if, else, else if, while, for, foreach, switch etc. to write PHP code block.
- From version PHP 5, it started supporting Object Oriented Programming (OOPS concepts). PHP supports abstract classes, visibility, interface objects, object cloning, inheritance, class auto loading, overloading and more OOPS concepts.
- PHP supports web concepts like session, cookies, persistent database connections, file uploading etc.
To learn more about PHP you can visit php.net website.