The Joys of PHP Coding

Back in 2002 when I first started building websites using raw HTML, I never would have imagined I would know what I do now about coding and building websites. I’ve written in the past about CSS coding, and its astounding how much I’ve learned in the last year alone about it! Not quite a CSS Ninja, but a disciple none the less.

Now, I’m learning PHP.

What is PHP? In essence, its original purpose was to help create Personal Home Pages. Its since become a way to create dynamic content that you wouldn’t be able to do with raw HTML.

Let me give you a quick rundown of why I love PHP and what this post is going to deal with:

PHP is, without a doubt, one of the easiest scripting languages to pick-up, and one of the most interesting. Mind you, I’ve worked with HTML, CSS, and JavaScript (albeit lightly with Java), and PHP is one of the easiest… after you learn a few things. PHP was created in 19954 from a hybrid of C Programming Language and Common Gateway Interface, and is written in a way that is very similar to, well, common everyday language.

Let me give you an example.

Say you want to add a copyright year to your page, but don’t like the idea of having to change it on a yearly basis because you will, most likely, simply forget its there. With PHP, you can easily add some code and you’re set!

The code can be seen here.

One of my favorite, easiest, and the most convenient uses of PHP is a time saver. Say you have a a header for your website with a ton of coding in it as well as links. If you’re like me, you may run into the problem of misspelling a link. With PHP, you can actually streamline it all and simply put your header into a new PHP document!

Take your header coding and put it into a new document called “header.php”. From there, delete the text in your original document with this: .

Now when you need to change your header, all you need to do is change the one page. You can do that with any page that tends to have static