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 Syntax
When PHP executes a file, it checks for PHP opening and closing tag and when it gets the tag, it starts interpreting PHP code and generates the output. As we use PHP opening and closing tag in file it makes easy to embed it with HTML, javascript etc. There are different ways to write PHP opening and closing tags, but default way is like <?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 #
or //
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.
PHP Help
To learn more about PHP you can visit php.net website.
I do believe all the concepts you have introduced for your post. They’re very convincing and can definitely work. Nonetheless, the posts are too short for beginners. Could you please prolong them a little from next time? Thanks for the post.
I just want to mention I am all new to weblog and truly enjoyed your web blog. Almost certainly I’m likely to bookmark your blog post . You definitely come with exceptional article content. Bless you for sharing your website page.
Thank you a lot for sharing this with all people.