Saturday, December 8, 2012

Introduction To Advanced PHP - Read Before Lesson 6

You Made It Past The Basics - Congratulations!
Please read over lessons 1-5 before starting this section.
By Stephon Unomon

 

       By now, you’ve got enough PHP knowledge under your belt to add basic PHP functionality in all of your websites. It’s pretty cool knowing things that a lot of others don’t know, and they’ll never be able to find out just by doing a “View Source” on your website (especially since you cant actually SEE PHP code by viewing the source in a browser!)

 

       In this section we are going to cover some more advanced PHP code. Things that you might not use just yet but once you are comfortable with PHP and want to get more out of it, you’ll be ready, my young apprentice.

 

       Quick tangent...before we get started here you are going to want to be able to place comments in your code. Why? It’s a heck of a lot easier to know why you wrote a specific line of code if you add comments...so you don’t come back in 3 months and ask yourself, “Was I drunk when I wrote this code??” Here are some examples of comment codes:

 

<?php

// This is a single comment line

# This is also a single comment line

/* This is a block comment, useful if you are working with a multi-line comment or are writing a story on your page that you don’t want people to see */

?>

You don’t have to use semicolons after each line, since the PHP server ignores comments because they aren’t actually commands. Now, on to more CODE! (ta-daaaa!)
 

No comments:

Post a Comment