Learning PHP

Print Friendly, PDF & Email

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:

<?php
 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.

Aside from being a relatively easy language to learn, PHP is also easy in terms of cost and resources.  No special software is needed beyond your favorite HTML or text editor and there’s a wealth of information on the web.  As with other languages, it’s just a matter of learning some basics and then getting in there and working with it to get experience.

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:
http://www.w3schools.com/php/php_intro.asp.

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.
http://en.wikipedia.org/wiki/PHP

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.

Subscribe to the newsletter to be notified of new posts.

You can stay up-to-date on new articles and resources from Comeau Software Solutions by subscribing to our newsletter. You can opt-out at any time.