PHP - Hypertext Preprocessor

PHP: Hypertext Preprocessor Definition and Meaning

According to AbbreviationFinder, PHP is a recursive acronym meaning P HP H ypertext P re-processor (initially PHP Tools, or P ersonal H ome P age Tools). It was originally created by Rasmus Lerdorf in 1994; however the main PHP implementation is now produced by The PHP Group and serves as the de factostandard for PHP in the absence of a formal specification. Released under the PHP License, the Free Software Foundation considers this license to be free software.

Overview

PHP is a widely used general-purpose interpreted language specially designed for web development and can be embedded within HTML code. It generally runs on a web server, taking PHP code as its input and creating web pages as its output. It can be deployed on most web servers and on almost all operating systems and platforms at no cost.

PHP is installed on over 20 million websites and servers in a million, the number of sites in PHP has shared some of its prominent site with new languages not as powerful since August of 2005. This same Wikipedia website is developed in PHP. It is also the most popular Apache module among computers that use Apache as a web server. The latest version of PHP is 5.3.2 (for Windows) from March 4, 2010.

PHP’s close resemblance to the most common structured programming languages, such as the C programming language and Perl, allows most programmers to create complex applications with a very short learning curve. It also allows them to get involved with dynamic content applications without having to learn a whole new set of functions.

Although everything in its design is oriented to facilitate the creation of a web page, it is possible to create applications with a graphical user interface, using the PHP-Qt or PHP-GTK extension. It can also be used from the command line, in the same way as Perl or Python can do it, this version of PHP is called PHP CLI (command line interface).

When the client requests the server to send it a web page, the server runs the PHP interpreter. This processes the requested Script that will generate the content dynamically (for example, obtaining information from a database). The result is sent by the interpreter to the server, which in turn sends it to the client. By means of extensions it is also possible to generate PDF, Flash files, as well as images in different formats.

It allows connection to different types of database servers such as MySQL, PostgreSQL, Oracle, ODBC, DB2, Microsoft SQL Server, Firebirdand SQLite.

PHP also has the ability to run on most operating systems, such as UNIX (and of that type, such as Linux or Mac OS X) and Windows, and can interact with the most popular web servers since it exists in version CGI, module for Apache, and ISAPI.

PHP is an alternative to Microsoft ASP and ASP.NET technologies (which uses C # VB.NET as languages), ColdFusion from Adobe (formerly Macromedia), JSP / Java from Sun Microsystems, and CGI / Perl. Although its creation and development occurs in the field of free systems, under the GNU license, there is also a commercial IDE (Integrated Development Environment) called Zend Studio. Recently, CodeGear (Borland’s programming languages ​​division ) has released an IDE for PHP, called Delphi for PHP. There is a module for Eclipse, one of the most popular IDEs.

History

It was originally designed in Perl, based on the writing of a group of CGI binaries written in the C language by the Danish – Canadian Programmer Rasmus Lerdorf in 1994 to display his Curriculum vitae and save certain data, such as the amount of traffic that your website received. The 8 of June of 1995 was published ” P ersonal H ome P age Tools” after Lerdorf combine it with his own Form Interpreter to create PHP / FI.

PHP 3

Two programmers Israelis from the Technion, Zeev Suraski and Andi Gutmans, rewrote the parser (parser in English) in the year 1997 and created the basis of the PHP3, changing the name of the language to the current form. Public testing of PHP3 immediately began and it was officially released in June 1998.

By 1999, Suraski and Gutmans rewrote the PHP code, producing what is now known as the Zend Engine. They also founded Zend Technologies in Ramat Gan, Israel.

PHP 4

In May 2000 PHP 4 was released under the power of the Zend Engine 1.0. On July 13, 2007 the suspension of support and development of version 4 of PHP was announced.

PHP 5

The 13 as July as 2004, PHP 5 was released, using the Zend Engine 2.0 (or Zend Engine 2). The most recent version of PHP is 5.3.1 (November 19, 2009), which includes all the advantages that the new Zend Engine 2 provides such as:

  • Better support for Object Oriented Programming, which in previous versions was extremely rudimentary, with PHP Data Objects.
  • Performance improvements.
  • Better support for MySQL with completely rewritten extension.
  • Better XML support (XPath, DOM, etc.).
  • Native support for SQLite.
  • Integrated support for SOAP.
  • Data iterators.
  • Handling of exceptions.
  • Improvements with implementation with Oracle.

Versions of the 5.2.X branch are still being released, with version 5.2.12 being released on December 17, 2009, although most are security updates

PHP 6

PHP branch 6 is scheduled to be released shortly. When this new version is released, there will be only two active branches in development (PHP 5 and 6), as PHP 4 development and support was abandoned on July 13, 2007.

The differences that we will find compared to PHP 5. are:

  • It will support Unicode;
  • cleaning of obsolete functionalities such as register_globalssafe_mode, etc;
  • PECL and ereg support removal;
  • improvements in object orientation;
  • inclusion in the core of xmlReader and xmlWriter as well as Fileinfo;

by reference will return an error;

  • Support for FreeType 1 and GD2 1 libraries is removed;

PHP Features

Advantage

  • It is a multiplatform language.
  • Completely oriented to the development of dynamic web applications with access to information stored in a Database.
  • The source code written in PHP is invisible to the browser and the client since it is the server that is responsible for executing the code and sending its HTML result to the browser. This makes PHP programming safe and reliable.
  • Ability to connect with most of the database engines that are used today, highlights its connectivity with MySQL and PostgreSQL.
  • Ability to expand its potential using the huge number of modules (called ext’s or extensions).
  • It has extensive documentation on its official page (Official Site), among which it stands out that all the functions of the system are explained and exemplified in a single help file.
  • It is free, so it is presented as an easily accessible alternative for everyone.
  • It allows to apply object-oriented programming techniques.
  • Extremely extensive and included native library of functions.
  • It does not require definition of variable types, although its variables can also be evaluated by the type they are handling at runtime.
  • It has exception handling (since PHP5).
  • Although PHP does not force those who use it to follow a certain methodology when programming (many other languages ​​do not either), even if it is aimed at a particular one, the programmer can apply any programming technique and / or development that allows you to write orderly, structured and manageable code. An example of this are the developments that have been made in PHP of the Design Pattern Model View Controller (or MVC), which allow separating the treatment and access to Data, the Control Logic and the User Interface into three independent components (see below Frameworks in PHP ).

Drawbacks

  • The obfuscation of code is the only way to hide the sources.

Syntax

Program Hello World PHP code embedded in HTML:

<! DOCTYPE html> <html lang = “es”> <head> <meta charset = “UTF-8” /> <title> Basic PHP example </title> </head> <body> <? Php echo‘Hello world ‘; ?> ​ ​ ​ ​</body> </html>

The PHP interpreter only executes the code between its delimiters. The most common delimiters are <?phpto open a PHP section and ?>to close it. The purpose of these delimiters is to separate the PHP code from other code, such as HTML. [4]

Variables are prefixed with the dollar sign ($) and their type does not need to be specified. Variables, unlike functions, are case-sensitive. Strings can be encapsulated in both double quotes and single quotes, although in the case of the former, variables can be inserted into the string directly, without the need for concatenation.

Comments can be written either with two slashes at the beginning of the line, or with a hash mark. It also allows multi-line comments encapsulated in /* */.

When it comes to keywords, PHP shares con conditions if, and loops, for and while function returns with most other C-syntax languages. As is usual in this type of language, the statements must end with a semicolon (;).

PHP - Hypertext Preprocessor