Search

Variables in PHP PDF Print E-mail
User Rating: / 0
PoorBest 
Programming - PHP
Saturday, 18 July 2009 08:24
Article Index
Variables in PHP
Variables in PHP
All Pages

 

 

 

Variables are used for storing a values, like text strings, numbers or arrays.

When a variable is declared, it can be used over and over again in your script.

All variables in PHP start with a $ sign symbol.

The correct way of declaring a variable in PHP:

$var_name = value;

New PHP programmers often forget the $ sign at the beginning of the variable. In that case it will not work.

Let's try creating a variable containing a string, and a variable containing a number:

$txt="Hello World!";
$x=16;
?>

 

 



Last Updated on Wednesday, 22 July 2009 07:26
 

Add comment


Security code
Refresh

We have 70 guests online