PHP Variables


IT Solutions

Variables:
A Variable is a named location in computer’s memory. it is used to store temprary during execution of a script.
The General syntax for declaring variable is given below:
Syntax:
$variablename=value;
For example:

once variable is declared you can refer it anywhere in the script just by using its name along with $ sign.
While declaring Variable you can must follows the following Rules:

1. PHP variables must start with a letter or underscore “_”.
2. PHP variables may only be comprised of alpha-numeric characters and underscores. a-z, A-Z, 0-9, or _ .
3. Variables with more than one word should be separated with underscores. $my_variable
4. Variables with more than one word can also be distinguished with capitalization. $myVariable
There is no need to specify data type for the variable. It will automatically determine its type base on the value that is stored in it. this is because…

View original post 7 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s