Dan is a web developer in London. He is interested in all things Internet, Linux and Mac.
RSS icon Email icon Home icon
  • Learning PHP – Part 2: Variable Basics

    Posted on October 25th, 2009 Dan 1 comment

    After part 1, you should be familiar with the echo statement, which outputs a string to the browser:

    echo 'This is a string';

    (Note that from now on the opening (<?php) and closing (?>) PHP tags are omitted from examples, but should still be included in any source code you create)

    On its own, it does not appear to be useful; after all we could have just written ‘This is a string’ in HTML for the same effect. The real power comes from using PHP variables.
    Read the rest of this entry »