What is variable?
Variable are the container of information. Variable can store many type of information like string, number, array, object etc.
Following are the rules for PHP variables:
Following things keep in mind regarding this topic(Minimum)
Variable are the container of information. Variable can store many type of information like string, number, array, object etc.
Following are the rules for PHP variables:
- A variable starts with the $ sign, followed by the name of the variable
- A variable name must begin with a letter(A-Z) or the underscore character(_)
- A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
- A variable name should not contain spaces
- Variable names are case sensitive ($a and $A are two different variable)
Following are the example of different type of variables
/** Variable store number**/ $a=10; $b=12; var_dump($a); var_dump($b); /** Variable store number**/ /** Variable store string**/ $name='Arun'; var_dump($name); /** Variable store string**/ /** Variable store array**/ $dataTypes = array('Int','String','Array','Object'); var_dump($dataTypes); /** Variable store array**/ /** Variable store Object**/ class ABC{ } $obj = new ABC(); var_dump($obj); /** Variable store Object**/
Following things keep in mind regarding this topic(Minimum)
- Whar are PHP Variables and their use.
- What are different types of variable like Array, Object and String etc
- Manipulation of varaibles
- Global, Static, local variables and their scope
- Dynamic varaibles
- Session variables and server variables
- Manipulation of variables.
No comments:
Post a Comment