PHP

From Linux 101, The beginner's guide to all things Linux.

Jump to: navigation, search

PHP, in it's current state, stands for PHP Hypertext Preprocessor. PHP is used for server-side scripting and is now widely used on many web sites to serve dynamic content. All sorts of possibilities are available with PHP.

PHP began as a web programming interface. Before PHP, there was CGI programming with Perl and C. Although both of these are sound methods for creating web applications, it never made it very easy to learn. With a steep learning curve, web apps never really thrived on common websites. Other problems were with ease of reading the code, Perl (unfortunately) has shorthand names for variables such as $[ that unless you know the language, can be frustrating to have to look up each symbol to find it's true meaning. And everyone knows how fun C can be (to)**read += &sometimes.

Then PHP came along and changed all of this. It is very easy to set up, very flexible, and very easy to learn. The power of PHP revolutionized web content and development. As you browse the web, a large number of the websites you visit exist using code developed in PHP.

As the popularity of PHP began to grow, the developers started adding in features to extend the usability. Features such as ones that made it useful as a system administration scripting language (like perl0, modules for graphic manipulation (GD), database modules (MySQL), libraries (PEAR), and even more. The open framework allowed for outside users to extend and enhance the features of PHP to new levels. Due to this flexibility, more and more production/professional websites began using PHP. As traffic to the sites grew, so did resource usage. The PHP team developed the Zend optimizer to enhance the execution speed of scripts.

PHP has found quick favor with web application development. Since all computers have a web browser available (regardless of the platform they use), it is the next logical environment for application development.

Today, PHP has built in handlers for database access, with drivers for ODBC, MySQL, PostgreSQL, and Oracle all freely available. This has lead to an incredible upswell in the number of application sites. E-Commerce, Forums, Content Management Engines, and more can be accomplished with PHP's broad set of features.

[edit] The Language

PHP is an interpretted language akin to PERL, but with a more confined approach to the syntax available. You have access to all the modern flow constructs, while, for, if, etc. There is even a movement that is using PHP for commandline utilities.

Why should you take the time to add PHP to your suite of tools?

  • Easy to write application code
  • Wide user base
  • Quick development times
  • Quick Database integration
  • Web centric approach to language implementation
  • Support for GET and POST methods from the web.

PHP is categorized by:

  • has a syntax very similar to C with some extensions that make it a scripting language.
  • has useful debugging information when you run your script if it fails.
  • An extensive list of commands to interact with many other programs such as databases and more
  • provides an object oriented scripting language that is easy to read the code.
  • very well documented

[edit] External links

Personal tools