Learning PHP

One of the projects I started late last year was learning some non-Microsoft technologies, one being PHP; a scripting language that is used behind websites in order to provide more dynamic features than ordinary HTML is capable of.  PHP has been in use since  1995 and is one of the most widely available web technologies.  If you depend on outside web hosting services to host a website like I do, you can pretty much count on your hosting service supporting PHP scripting.

My own experience  with PHP is still at the academic stage and certainly not ready to be advertised on the resume but the basics of the language aren’t hard to learn, especially for someone already familiar with basic programming concepts.  A basic example of a PHP  script would look something like this:

 echo "Today's date is ".date("l, F d, Y").".";

This script could be inserted anywhere  in the body of an HTML web page and would produce the following output:

Today’s date is Sunday, April 08, 2012.

The opening and closing <?php … ?> tags are what signal to the PHP processor on the web server that the content between the tags is to be processed as PHP code.  Pages using  PHP scripting are also often named with a .php extension instead of the normal .htm or .html extensions.   The echo command on the second line instructs PHP to  output the following content to the page and it calls the date() function which outputs the current date and formats it as needed.

I like having a reference book at my side so I recommend the above book; Learning PHP, MySQL, and JavaScript: A Step-By-Step Guide to Creating Dynamic Websites (Animal Guide) by Robin Nixon. This book will also give you an introduction to the Javascript scripting language and the MySQL database environment, two other important technologies in web development.

As I said, there’s a lot of good information on the web, too.

W3 Schools has an introduction and reference to PHP:

I also like to start with Wikipedia when learning about a new subject. I find that, at the very least, it can point me in new directions.

If you’re interested in programming and want to work on websites, PHP is a valuable skill to have.  As an exercise, go to one of the larger job search sites like CareerBuilder.com or Monster.com and do a keyword or skill search on the job listings for PHP.  This is a helpful way to gauge the demand for any skill.

Sign up for our newsletter to receive updates about new projects, including the upcoming book "Self-Guided SQL"!

We respect your privacy and will never share your information with third-parties. See our privacy policy for more information.