Category Archives: PHP variable declaration

PHP variable and its Declaration

some of you are wondering what is variable…ok if you need to store water what do you need ..simply glass ..bucket something that can store water ya.
Ok this is variable… the something(memory ) ..bucket that can store some value for further use …variable is nothing more than this.

Than how to use variable:
<?php
$message = “www.phpfresher.com”;
echo $message;
?>
Check out this  exercise and try yourself:

<?php
$qty = 5;
$price = 10000;
$amt = $qty*$price;
echo “Rs. “.number_format($amt, 2);
?>
Note: PHP variable is declared with the dollar($) sign at the start.