Home arrow Tutorials arrow What is PHP (Hypertext Preprocessor)

Web Development

Welcome to Web Development section. Please choose a category. 
  • Hrvatski tutorijali
    Ovdje su objavljeni razni tutorijali na hrvatskom jeziku na temu PC, programiranje, web development, savjeti, trikovi, optreba racunala itd.
  • Tips / Tricks
    Articles about various tips and tricks concerning Windows, Linux and other OS usage.
  • JavaScripts
    Code snippets, tutorials and tricks for JavaScrip language.
  • PHP & MySQL
    Tutorials, code examples, tips and tricks for PHP and MySQL development.
  • Tutorials
    Place for tutorials about using various application in best and simplest way.
What is PHP (Hypertext Preprocessor) PDF Print E-mail
(0 votes)

What is PHP?

PHP is an abbreviation for Hypertext Preprocessor, and is probably one of the most popular server-side programming language over the globe. The acronym might be confusing because it does not represent the capital words of full title. This type of acronym is known as a retronym or inverted acronym. Sometimes it is also referred as Pre HyperText Processor, or in the very beginning as Personal Home Page. PHP is originally designed for developing simple web gadgets and later on it became a ground for professional web applications. A Web application can be anything from a simple "contact us" form or visitors counter on a website through to a fully-featured “blogging” system, online shop, Content Management System or forum system.

The history of PHP

PHP was originally an acronym for Personal Home Page.
In early 1994 Mr Rasmus Lerdorf, a Danish programmer used to administer and maintain his personal home page. He soon found out the lack of support to build specific gadgets for his HTML website. Lerdorf decided to create a set of tools based on another, older scripting language called PERL. The tools were used to perform tasks such as displaying his resume and recording how much traffic his page was getting. He combined these binaries and created so called PHP/FI, which had more functionality. PHP/FI (Form Interpreter) included a larger implementation for the C programming language and could communicate with databases, enabling the building of simple, dynamic web applications.

Soon after that Mr Lerdorf released PHP in public on June 8, 1995 to accelerate bug location and improve the code with the help of growing community. This release was named PHP version 2 and already had the basic functionality that PHP has today. This included Perl-like variables, form handling, and the ability to embed into HTML. The code syntax was similar to Perl and C but was more limited, simpler, and less consistent.

Zeev Suraski and Andi Gutmans, two Israeli developers at the Technion IIT, rewrote the parser in 1997 and formed the base of PHP 3. They are responsible for changing PHP’s original name, thus they renamed the project into PHP: Hypertext Preprocessor.

The official launch of PHP/FI 2 was released in June 1998. Suraski and Gutmans then started a new rewrite of PHP's engine, producing the Zend Engine in 1999. They also founded Zend Technologies in Israel.

On May 22, 2000, PHP 4, powered by the Zend Engine 1.0, was released. It has integrated better object oriented support, partly implemented in previous version, which moves PHP deeper into mainstream. The project development is now being led by PHP group, a large community of professional code developers.

 On July 13, 2004, PHP 5 was released, powered by the new Zend Engine II. PHP 5 included new features such as more improved support for object-oriented programming, the PHP Data Objects extension (which defines a lightweight and consistent interface for accessing databases), and numerous performance enhancements. The most recent update released by today is PHP 5.2.9 (stable). As of August, 2008 older versions are no longer under development and security updates will not be released anymore.

In 2008, PHP 5 became the only stable version under development.
PHP 6 is under development alongside PHP 5. Major changes include the removal of several features considered as security flaws or potential security issues, such as “register_globals”, “magic quotes”, and “safe mode”. The reason for removing magic quotes was that it had an unpredictable nature, and project leaders decided to drop it.

PHP does not have complete native support for Unicode or multibyte strings. Unicode data is used for safe transfer of various multilanguage characters between different systems or storage facilities, such as databases. The application can be written to support it but since the engine is not fully prepared application might experience unexpected behavior. After linking with other services UNICODE data might be corrupted or not understood. Fully featured Unicode support will be included in PHP 6.

Since PHP4 was very popular, the transition to PHP5 did not happen as expected. As of February 5, 2008,  the GoPHP5 initiative powered by community of PHP developers helped in promoting the transition from PHP 4 to PHP 5.
It runs in both 32-bit and 64-bit environments, but on Windows the only official distribution is 32-bit, requiring Windows 32-bit compatibility mode to be enabled while using Microsoft IIS server in a 64-bit Windows environment. There is a third-party distribution available for 64-bit Windows but it is not under official development of PHP Group.

How does it work?

PHP is also known as a server-side programming language. This means that it runs on the Web server where website originates. After all a webpage is actually a “product” of PHP. Most Web programming languages are server-side, but some, such as JavaScript, are client-side, which means they run on the visitor’s web browser.
Server-side languages give you more flexibility as they can do many things that are almost impossible to do with JavaScript — for example, working with files and databases, or advanced manipulation of images. Naturally, such features present security issues on client-side thus they are not supported.
Server-side code is potentially more secure than client-side code. Since JavaScript code is sent to the web browser it's easy for a visitor to view and edit the code. Server-side code, on the other hand, remains on the Web server and isn't accessible to visitors to the site. The visitors can see only what server-side generates, that is the html code. It is ment to be an easy yet powerful way to create dynamic web pages that actually interact with your visitors. Standard HTML can create useful and well formatted web pages. With the addition of server-side programming language as PHP you can collect data from your users, create specific content on the fly, and do many other things that HTML alone is not able to accomplish.

The simple process of communication between client and server is shown in the image bellow.

The image shows a centralized web server with several clients attached to it. The process begins when client, a surfer or visitor to a certain website, clicks a link, or request a content from web server (so called query). The Server is then validating the input and passing the data to PHP interpreter (engine). PHP processes the website’s PHP scripts and outputs generated HTML back to the client. As with many scripting languages, PHP scripts are normally kept as human-readable source code, even on production web servers. In this case, PHP scripts will be compiled at runtime by the PHP engine, which increases their execution speed. While the code is being processed PHP is also able to communicate with other services, for an instance a mail server, or a database where user’s login credentials can be stored, or contact another server in different network. The HTML code returned to the client is then being rendered by local Web browser (client-side). The result of a rendered HTML code is what client recognize as a human viewable webpage.

PHP is OpenSource

One of the best features of PHP is that it is absolutely free. The PHP engine (ZEND) is Open Source, which means anyone can access and work on the engine's source code. However applications written in PHP may not be published under OpenSource or similar licences. You can register and copyright your work, but the engine which processes it remains OpenSource. This means that PHP will exist and be developed for a long time. PHP is free to download and use, which is one reason why it is so popular among web hosting companies. You will find that the vast majority of web hosting companies support PHP.
Nowadays, there are many similar projects, commercial or similar to OpenSource that are used for web developing. There fore PHP constantly competes with the following server-side programming languages:
•    Microsoft's C# - Visual Basic.NET - ASP family,
•    Sun's Java - JSP
•    Macromedia's ColdFusion
•    CGI – Perl
•    Phyton


Despite majority of advanced programming language PHP is easy to learn. Data structures, arrays and variables are able to hold any type of object, variables do not need to be declared but the developers are advised to do it, and the syntax is remarkably simple.
Unlike many advanced and complex languages, such as C# or Perl, which are primarily supported by more general programmers, many PHP programmers know no other language. This occasionally causes PHP to be dismissed as a less important language with lower reputation, but its growing popularity and the many popular and professional websites available only because of PHP are breaking the myth.

PHP has occasionally been criticized for security flaws, in comparison to languages such as ASP. A lack of easily understandable error messages, sometimes too strict configuration file, and an obviously incomplete set of built-in functions are also mentioned as areas which could be improved in near future.

Nowadays the PHP is installed on more than 20 million websites and 1 million web servers. The community is growing rapidly and the future is very promising.


Next >
What's your favorite Internet browser?


Lost Password?


Coming soon...