If you have learned C,C++ you know about variables.Also in PHP ,variables are used.Variables in php used to store information and also to get back information when we need.
Points to Remember while using PHP Variables
- Add $ before variable name like this $variable
- Variables are case-sensitive.Example:There is difference between $variable & $Variable
- Variable should not start with numbers like $123.
- Variable should not start with * like $* variable.
Use wamp server to learn php If you have not yet used see the below link,
- Open notepad copy and paste the below code in notepad
<html> |
- You get output like,
- Save in php format.Goto wamp folder>>www and place the php file.Open wamp server
- We have used <br> to display name2 in next line.
- If you want to connect two variables add .$variablename like below
<?php echo"$variable".$Variable;?>
- You get output like,
There are more things in php variables we will share in further posts.
0 comments :
Post a Comment