28.4.1. Variables

Variables are those elements that are given variable values, depending on the case. Here is an example:

<? (1)
if ($foobar == 1)){ (2)
 echo "The value is 1"; (3)
} else {
 echo "The value is not 1"; (4)
?> (5)
As with every PHP script, we have to designate its start and end. Here is the start...
We check if the foobar variable has the value 1.
If it does, we output a message. We do this with the echo function. This functions will print whatever is included in the double quotes. The double quotes may contain other variables (in which case the echo command will print their values), HTML code etc. If you want to print double quotes, you have to escape them with a backslash.
If it doesn't, we also output an aproppriate message.
...and here is the end of the script.

See also PHP variables.


Site Info v2.2.2

Last SeenLast Seen
  • neralex
  • elnegro
Server TrafficServer Traffic
  • Total: 377,270,901
  • Today: 50,036
Server InfoServer Info
  • Feb 23, 2019
  • 04:57 pm CET