The tag used to start PHP interpreting code is
<?php ... ?>, which can be
You can use
// for a
single line comment or
*/ to span multiple lines.
All PHP statements must end with a semicolon (
With the exception of constants, all PHP variables must
Variables hold a value that can be a string, a number, or other data.
$variable = 1 is an
assignment statement, whereas
== 1 is a comparison operator. Use
$variable = 1 to set the value of
$variable == 1 to find out later in the
equals 1. If you mistakenly use
= 1 where you meant to do a comparison, it will do two
things you probably don’t want: set
$variable to 1 and return a
true value all the time, no matter what
its previous value was.
A hyphen is reserved for the subtraction operators. A
would be harder to interpret if hyphens were also allowed in
variable names and, in any case, would lead programs to be
Variable names are case-sensitive.
$This_Variable is not the same as
You cannot use spaces in variable names, as this would
confuse the PHP parser. Instead try using the
To convert one variable type to another, reference it and PHP will automatically convert it for you.
There is no difference between