PHP

Zend Studio 7
PHP, which is a recursive acronym standing for PHP: Hypertext Processor” is a web-scripting language that can be embedded in HTML pages to allow for the serving of dynamic content. Based o­n an amalgam of Perl, Java and C, many programmers find it relatively easy to use in developing web based applications.

One of PHP’s key strengths is its strong support of open source and free software. It interfaces extremely well with the Apache web server. In addition, although it can work with just about any database server, many users combine it with MySQL for a low-cost environment in which to develop web applications. In fact, it usually makes up the P in the LAMP architecture for web applications—Linux, Apache, MySQL and PHP. Another of its strengths is its maturity. Originally written in 1994, it has been through multiple updates and is now well into its 5.0 version. Its suitability as a backbone for major websites is demonstrated by the role it plays in generating the user interface of Facebook.

Coding in PHP is somewhat similar to a less complicated version of Perl. The code is typically embedded within delimiters in an HTML page for an interpreter to then execute although compilers are also available to create native code which can run more efficiently. Although it has supported object oriented programming for a number of years, the most recent version of PHP, version 5, has a new system which has greater similarity to C++.

Perl’s advantage over Microsoft’s Active Server Pages (ASP) technology is its openness. It runs o­n just about every platform and can work with countless external modules. Another competitor is Adobe’s Cold Fusion which offers a rich integrated development environment, but requires installation of an additional piece of proprietary software o­n the server side.

Coding standards are guidelines, generally stylistic, that give source code universal qualities. These universal qualities make the code more compatible, maintainable, and readable than it would otherwise be. Some coding standards form among the wider communities center o¬n a particular language, such as PHP. Other coding standards are specific to development teams.

PHP was designed for web development as a server-side scripting language but is also used as a general-purpose programming language. It has become very popular and now PHP runs on more than 244 million websites and over 2 million web servers. It was first invented in 1995 by Rasmus Lerdorf but now it is produced by the PHP Group for reference implementation of PHP. PHP at first meant "Personal Home Page" but now stands for "Hypertext Preprocessor".

PHP is a type of programming language. While Rasmus Lerdorf originally conceived this widely used scripting language for web development, it has since grown into a more versatile tool. The language’s popularity has given rise to a set of coding standards that have become widely accepted. However, there are platforms that make use of PHP, such as the Drupal content management system, that set forth their own coding standard. These various coding standards can make it difficult for the PHP coder.

An example of where these standards differ is in the use of PHP code tags, which programmers use to delimit the start and end of PHP code. In a standalone file, this delimitation serves o¬nly to mark the entire file as PHP, such as HTML tags in an HTML-only web file. In complex scenarios, programmers must combine multiple languages, such as HTML, JavaScript, and PHP. In these cases, the code tags serve to delimit the start and end of PHP code blocks from the blocks of other languages.

The default form of a beginning PHP code tag is “< ?PHP” and it is given closure using “?>”, minus the quotes. However, the shorthand form of “” has become the preferred coding standard. Nevertheless, in order to avoid conflicts, the popular platform Drupal requires PHP code blocks opened with the traditional “< ?PHP”. To further confuse matters, as of Drupal 4.7, a closing tag, “?>”, at the end of a file is purposefully omitted. This is an inconsistent problem across PHP-using platforms that cause coders to keep track of the differences.