Constants are like any other variables to store information but the difference between the constant and a variable is value of constant can not be changed but the value of the variable can be changed at any point of time. You can store any kind of value which is not intend to change like mathematical constants like value of pi, paths to files etc.
echo"Output of pi is :".pi."<br/>";
echo"If we would like to print constant within \"\" sign output would be: pi <br/> ";
echo"Since pi is a constant, we need not to use '$' sign before constant";
Output of pi is :3.14
If we would like to print constant within "" sign output would be: pi
Since pi is a constant, we need not to use '$' sign before constant
Posted on: February 13, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles