So what are those thingys anyways?
PHP is an "Interpreted" language. This means
that PHP is NOT compiled, it is parsed at runtime (the time when the script is
run. i.e. user visits the page).
All PHP code is enclosed within "". Functions (text that causes action
in the script), are ended by the semicolon (";"). Comments (or escaped
text) are as follows:
#shell style comment
//comment
/* C-style comments */
Ok, so what exactly does a PHP page look like?
Now lets take a look at this. First, we initialize the PHP
interpreter. On the second line, we assign the variable "$name" to the
value "Jehanzeb Manzoor". This is done by first giving the variable a
name.
All variables (with the exception of constants, which you need not to worry
about) start with the dollar sign ("$"). After we give the variable a
name, we assign it a value, with the Assignment Operator ("="). The
value can be enclosed in either double or single quotes. Use double when you
want to invoke"Variable Interpolation". This means that if a variable
is found in between " and ", the value will be printed. But, if you
use single quotes, the values will not be printed, instead, the variable name
will be printed.
Example:
Today you've learned a little of what PHP can do. Now you
understand what a sample PHP page looks like, and how one works. You have
learned about variables, the echo statement, and variable interpolation.
For further learning, I suggest you go out, and write your own version. Play
around with variables, the echo statement, and variable interpolation.