Thursday, March 5, 2009

PHP Variable – Assigning and Reassigning Variables in PHP

  Kaushal Patel       Thursday, March 5, 2009

Assigning Variables

Variable Assignment in PHP is very easy. Just write the variable name and add equal “=” sign and then the expression that you want to assign to the variable name.

Reassigning Variables

In PHP you will be pleased to know that you can reassign the variable value after declaring it. You can change the values of PHP variable even if the assigned values are different data types. For example.

$value = “Value”;

$value = 5;

You can see the first statement contain string and the second one contain numeric value. Thus you can reassign the variable value even their data type is different.


logoblog

Thanks for reading PHP Variable – Assigning and Reassigning Variables in PHP

Previous
« Prev Post

No comments:

Post a Comment