php 101

Introduction

PHP, or the PHP Hypertext Processor, has emerged as the most widely used server-side web programming language in use today. PHP makes it easy for web pages to interact with databases, present different kinds of content to different users, manipulate text, send email, process forms, perform advanced mathematics, or do most anything else that involves delivering dynamic data into web pages.

Note: When we say "dynamic," we're not talking about animations or whiz-bang graphics -- PHP is just for altering and controlling the data that goes into a web page - primarily text. For whiz-bang "client-side" animations, you'll need Flash or JavaScript.

Literally tens of thousands of software applications living on web servers around the world - from blogging engines to banking systems, bulletin boards to social networks like Facebook - are written in PHP. But PHP isn't just for big software projects - it's also an excellent little Swiss Army Knife for small, custom, or one-off jobs on ordinary web sites. Because it's relatively easy to learn, popular content management systems such as WordPress and Drupal have become enormously popular.

PHP's success comes from two main factors: Ubuiquity and ease of use.

Ubiquity: Because PHP comes bundled with the Apache web server, and because Apache is the most popular web server software in use, PHP is widely available. Even web servers that don't run Apache often run PHP, since it's been ported to run on other servers as well. As a result, virtually every commercial web hosting account comes with PHP pre-installed and ready to run. Developers don't need to install or configure a thing to get started.

Ease of use: PHP has a very low barrier to entry. As you'll discover in a moment, a web developer with existing HTML and CSS skills can literally insert one line of code into an existing HTML document, rename the file extension, and have a working PHP document. The developer can then simply build on that base one line at a time, acquiring knowledge as she goes. This is in stark contrast to the learning curve for languages such as Java, or full-blown frameworks like Django or Rails.

Because there are tens of thousands of PHP developers out there, it's very easy to find answers to PHP questions. Blog posts, forums, and documentation abounds. You're never far away from a helpful community of programmers ready to help out (as long as you've tried to help yourself first!)

This is a "101" tutorial, and is by no means exhaustive - it provides just enough information to get familiar with the basic concepts of server-side programming.

Filed under: Web Development