Basic PHP Programming About Variables

Variable:

         Variable are nothing but identifires which point to memory location in which data is stored.vgariable in PHP are quite different from compiled language such as a C and Java. This is becase PHP variables are weakly typed. This means that when a variable is being define there data type is not declare prior their use. This PHP variable take its data type from the user define value that is being stored in it. As a result a PHP variable can change its type as often as need.
    A PHP variable Must be Named/declare starting with the $ character follow bya letter. The rest of the variable named can consist of a mix of the both alphabets and numbers. The Underscore (_) character can also be used in variable names. It is used as a replacement for space as space in character that can not be used when naming as a php variable.


Example: 

$no=1213;
$marks=350;
$name='John';

The First variable is a Numeric variable to store a numeric data in memory $name is a string variable that store the String Value.
Basic PHP Programming About Variables Basic PHP Programming  About Variables Reviewed by Unknown on 7:52:00 AM Rating: 5

No comments:

Powered by Blogger.