What is PHP?
PHP started off being a small open source project that developed as more developers realized how powerful it was. Rasmus Lerdorf revealed the 1st version of PHP back in 1994.
A few salient features of PHP
- PHP is a recursive abbreviation for “PHP: Hypertext Preprocessor“.
- PHP is a server-side scripting language which is embedded in HTML. It can be used to manage dynamic content, databases, session tracking, building e-commerce sites and powers the web applications.
- The WordPress is a major example developed in PHP besides many others.
- PHP can work with many popular databases including MySQL, PostgreSQL, Oracle, Sybase, Informix, and Microsoft SQL Server.
- PHP is fast in its execution, particularly when compiled as an Apache module on the Unix OS. The MySQL server once started, executes even very complex queries with huge resultsets in record time.
- The PHP works with many major protocols such as POP3, IMAP, and LDAP. The PHP4 included support for Java and distributed object architectures (COM and CORBA), making n-tier development possible.
- PHP Syntax is like the C language.
General uses of PHP
- PHP carries out system functions, i.e. from the files in a system it can create, open, read, write, and close them.
- PHP works with forms, i.e. collect data from the web forms, can save data to a file. Through email, you can send and return data to the user.
- You may add, delete, update elements or rows in your database through PHP.
- Create and access cookie variables and delete cookies.
- PHP can encrypt data in different formats. Details in coming chapters how and which formats.
Features of PHP
5 significant features that make PHP stronger:
PHP Hello World Example
To give a taste of PHP, let us first start with a simple PHP script. Since “Hello, World!” is a general example, first of all, we will create a friendly little “Hello, World!” script.
As mentioned earlier, PHP is also embedded in HTML. That means, in your normal HTML you may have PHP statements like this:
<?php echo “Hello, World!”;?>
The result of the above code is:
If you go through the output in above example, you’ll notice that the PHP code isn’t there in the file sent from the server to your browser. All of the PHP code in the page is processed in web server while the only thing returned to the client from the Web server is pure HTML as the output.
Next chapter will guide you through setting up the PHP Environment followed by all concepts related to PHP to make you feel comfortable with PHP language.