Variables are "containers"that can storing information.
PHP, a variable starts with the $ sign, followed by the name of the variable.
For example:-
PHP, a variable starts with the $ sign, followed by the name of the variable.
For example:-
<?php
$txt = "Hello!";
$x = 50;
$y = 101.5;
echo $txt;
echo "<br>";
echo $x;
echo "<br>";
echo $y;
?>
Here php starts with "<?php" and end with "?> " , and $ sign used to declare variable. now $text stores a string value , $x will stores the numeric value and $y stores the decimal values simultaneously. So now we have to print this values in output. therefore we use echo for print the output value.
Comments