02 Dec PHP – An Introduction to the Programming Language
PHP, which stands for PHP: Hypertext Preprocessor, is an open source HTML-embedded scripting language generally used for websites all over the internet. It’s main purpose is to allow for the quick programming of interactive, dynamically generated web pages.
PHP 5 is the current version of the language with its main enhancements being in the areas of object-oriented programming. All versions of PHP newer than version 2 are currently supported and in use.
While it is primarily used for web site programming, PHP can also be used as a command-line scripting language suitable for simple text processing tasks. It also can be used to develop desktop applications with a graphical interface using the PHP-GTK library extension, but this isn’t the best use for PHP when compared to other languages designed for GUI development.
A major advantage of PHP is its neutrality towards operating systems and web server software. It works on all major operating system platforms, and supports most of the major web servers including Apache and Microsoft’s IIS. Another main feature is PHP’s ubiquitous database support which includes both large proprietary systems like Oracle and open source options like mySQL.
The success of PHP is an excellent statement about the quality of open source initiatives in a largely proprietary software development world.
The dynamic content could be anything from a simple GIF image to an entirely customized web page rich with features ranging from basic HTML all the way to graphically intensive interactive Flash. There are other more creative uses as well, but it’d be virtually impossible to name them all given the remarkable flexibility of PHP.
Given the extensibility of the language it is difficult to go into specifics of all the functions as there are probably thousands of them in existence that supersede the roughly 100 base functions. PHP does, however share syntax with most common high level languages such as blocks for ‘if’ conditions and ‘for’ and ‘while’ loops. As with C/C++ variable names are case sensitive and with few exceptions variables must be declared in advance of being used as well as specified in type. The types of variables available in PHP are remarkably similar to those found in C/C++ and Java.
Modern versions of PHP are object oriented just as modern versions of C/C++ are. In fact, PHPs relationship with the C programming language is so close now that it is possible for developers to write extensions in C to add additional functionality to the PHP language.
Lastly, integrated event handling isn’t limited just to predictable behavior. PHP has since its inception as a public project strong error handling capabilities which is mission critical. Who wants an unexpected event to crash an entire site or even just an aspect such as e-commerce?