Thursday, July 31, 2008

What is PHP?

PHP (Hypertext Preprocessor) is a server-side scripting language meant to create dynamic web pages and is run on web servers like Apache. PHP takes the code/script you write as input and provides a web page as its output.

It is an open-source programming language and could be deployed on most web servers, operating systems and platforms free of charge.

PHP also supports most databases like MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc.
As mentioned earlier, PHP is a server-side scripting language. This means that a PHP page is processed on a Web server by a PHP script engine. When the client makes a request for any page, the request is sent to the server; the server locates the requested page, executes the PHP code and sends the result to the browser (client) in the form of HTML. The browser then compiles the HTML to display the output.

Now, you’d be probably thinking, “why PHP? Why not the other web-programming languages?”

Firstly, PHP is cross-platform.

Furthermore, PHP is a regular and a more well-defined language. It is hence easier to learn than most other programming languages such as Java.

And, due to this very reason, PHP is becoming increasingly used everyday by programmers all over the world for building web applications.

Java is one of the many programming languages that are used for developing web-applications. Despite being object-oriented, Java comes with its own drawbacks. One drawback is its complexity – the complexity presented by the several layers it contains. And applications developed using PHP are several times faster than those developed with Java.

As PHP evolved, it brought into it the best features of Java, Python, PERL, C, C++ etc.