What is PHP?

Hello, we would like to draw your attention to a very popular, simple and at the same time, a multi featured language for web programming called PHP. If you ever want to start web development, you will not be able to do that without learning this language.

Let's begin from the history of its development. PHP is a scripting programming language for general use. It is developed as open source software, and it is used to develop dynamic web sites.

The history of the language began in 1994 by the Danish scientist, who has created a set of scripts in Perl/CGI to record visitors. Initially, PHP name was shortened version of the "Personal Home Page" combination of words. The second version was written in C in 1997 and PHP of version 3.0 has been developed by Israeli programmers that wrote code interpreter and it was released in 1998. The main advantage of the third version was ability to load modules that have made it possible to work with various databases and protocols. From this version, PHP is an acronym for PHP: Hypertext Preprocessor.

The next version of PHP 4.0 was released in 2000, which included a new engine - Zend Engine, has been equipped with new features to support sessions, output buffering and new language instructions.

Efficiency of interpreter was improved in the fifth version. It became possible to support XML markup language. Also, there are open, closed and protected members and destructor, the final members and methods, namespaces, interfaces, objects cloning.

Development of the sixth version began in 2006 and it's most important change was Unicode, but in 2010 it was considered as unpromising.

PHP is supported by many operating systems as can be used in web servers such as Microsoft Internet Information Server, Netscape, iPlanet and Apache.

The main area of use of the language is writting code by entering it in the command line. it is not necessary to use a web server and a browser. These scripts are useful when doing some regular job. You can write some code to execute it directly on the server. This language is used in this way very ofthen and you will need a Web server and installed PHP module for this. Some scripts can be used for creating GUI baes applications, which are executed on the client side.

The main advantage of PHP language is its simplicity. You can solve the problem with a single record or with a few lines of code, it all depends on your requirements. But the script will always be executed if it is put after the opening «<? » and before the closing «?> » syntactic brackets. It will be very easy for experienced programmers to work with applications in this language, as it is similar to C and Perl. Although, it is young, but it is currently very popular and widely used by Internet developers. PHP is often connected with the HTML, but it also goes well in dealing with XML, WML and JavaScript. PHP allows you to work with external components, such as COM objects in Win32.

Let's look at the syntax of writing code in a given language.

PHP code can be started and finished in this way <?php ...?> Here is an example of a simple line outputting. <?php echo 'Hello!'; ?>

This code contains simplest function that puts text to the screen ( echo 'Hello!'; ), which can display both text and variables.

As for names of variables, any variable must begin with the character «$». You just need to know that this language is case sensitive. Processing of variables is also performed in strings which are placed in double quotes. Instructions are divided by a semicolon ";" but exception is a case when they are used in cycles or in "if / else" structures.

You do not need to specify type when variable is declared. There are scalar, non scalar and pseudo types in PHP. Scalar types include objectives, logical, string, floating point types and type of Null. Non-scalar types include array of objects and resources.

So, in this article, we briefly described the main characteristics of the PHP language, it's history of development and syntax, which you can use to create client or any server applications and web resources.

Best regards, DYAMAR Engineering.


All rights reserved. You may not copy or distribute, electronically or otherwise, any part of this article for any purpose without prior written permission from the DYAMAR Engineering.