Pages

PHP Variables

Like in any other programming language, in PHP a variable is also used to dedicate some memory space to store some data.

Things to Remember...
  • The variable name must be a alpha-nemeric or may include underscores.
  • After $ sign the variable name should have letter or underscore i.e a variable name must not start with a numeric value.
  • Spaces are not allowed.
Declaring and initializing variables is very simple in PHP,we don't need to care about the data type.A variable name in PHP must start with a $ sign.Have a look at the following code...
This is how easily we can declare and initialize a variable without even setting it's data type.
Some examples...

 

0 comments:

Post a Comment