PHP – Variables

A variable is a means of storing a value, such as text string " Conkurent LLC " or the integer value 8. Once declared, a variable can be reused throughout your code over and over again. In PHP, you define a variable with the following form:
      $variable_name = Value;
The following script creates a variable containing a string, and a variable containing a number:
       $txt=" Conkurent LLC";
There are few things you need to note when working with PHP variables:
  • A variable name should only start with underscore "_" or a letter.
  • A variable can only contain letters, numbers or underscore. In another words, you can't use other funky characters like <^# in your variables names.
In PHP, the variable is declared automatically when you use it. In the example above, you see that you do not have to tell PHP which data type the variable is.
PHP introduction
PHP Operators
PHP While Loops
AJAX Introduction