Data is stored in variables in any programing language. The variables declared in PHP are a bit different than other programing languages. Each variable name starts with "$" sign. If I like to name a variable as iknowPHP variable , it will throw an error.
The way to declare a variable in PHP is simple though.
$iknowjava = 5;
$iknowmyjava ="Deepak";
Few points :
- Variable name can start with $ only
- Variable name can have only alphabets or numbers or underscore or combinatiion of these three. Spaces in variable names are not permitted
Once done with the variables , PHP will itself decide on what variable it is , whether its a string variable , a char or a number , depending on the value it has.
So we will move to next important part in PHP , the various operators.
No comments:
Post a Comment