Diving into PHP: Day 2

Now that we’ve downloaded the necessary files, let’s take a look at how to create variables and if statements. We’ll also examine the difference between using single and double quotes.

Day 2: Variables

Download the Source Code


  • Meshach says:

    Ok Jeffrey, this is just… WOW!

    Thank you so much! Pure awesome.

  • John Benson says:

    I Could NOT WAIT!!! to get back home so that I could check out your new series and now there are 3 of them for me to see I’ve been waiting for these !!!

  • Ryan2406 says:

    Thanks, These are very helpful and save time.

  • toul says:

    Great…i love it. Thank you Jeff!

    Can someone tell me when i have to use single Quotes ‘ ‘ and when i use the double ones ” “?

    “This” is a string-variable and
    ‘this’ is just plain text?

    Jeff told that in later, more complex porjects we will mixed the use of both quotes…

  • shin says:

    Jeff is an experienced tutor.

  • toul says:

    it seems that noone can answer my simple question :(
    about the use of single and double quotes.

  • Julia says:

    Hi there
    A friend sent me a link to your site when I mentioned I “needed” to learn PHP for school. However, watching this video has made the entire idea of programming extremely fascinating, and it’s really gotten me into it.

    Brilliant job on the video, it’s really easy to understand and informative.

  • Belinda says:

    Your screencasts are amazing. Thank You!!!

  • Wonnie says:

    My only question, is why you say “P” instead of “Period” i’m probably hearing wrong, as it is late and school burned me out today. But that really threw me off, cause I typed a “P’ and saw a period and was like…Waiit a minute…That’s a P?!

  • Tarek says:

    really really interresting and so easy to follow , i’ve never seen like this simple teaching method that’s what we can call diving into php.

    keep going dude we are in need of such videos ,we don’t need tutorials instead we need to understand the concept of the language and that’s what you’re doing

  • Daniel Balfour says:


    Great series, certainly something I plan to watch, if only to brush up a bit. Question for you -

    In this tut you say that you can’t call a variable value if you use single quotes. Ergo:

    //This returns: Hello, $myVariable

    But what if you wrapped $myVariable in curly braces? Wouldn’t that do the trick?



    $myVariable = ‘Jeff’;
    echo ‘Hello, {$myVariable};

    // Should return: Hello, Jeff

    Are you sure that’s accurate?

  • Ole says:

    @Daniel Balfour: No, that would just echo out “Hello, {$myVariable}”

    $myVariable = ‘Ole’;

    echo ‘Hello, {$myVariable}’;
    echo “Hello, {$myVariable}”;

    if ($myVariable == ‘Ole’) {
    print ‘Your name is Ole!’;
    } else {
    print “Your name is not Ole!”;

    Hello, {$myVariable}
    Hello, Ole
    Your name is Ole!

  • Arvie says:

    how to download the videos?

  • seointexas says:

    This is very thorough for someone looking to learn php. I think you are a great teacher and should keep going.