Table of Contents
<h2>Creating_Variables</h2>
<p>In PHP, a variable starts with the $ sign, followed by the name of the variable: </p>
<?php
$x = 5;
$y = "John";
echo $x;
echo "<br>";
echo $y;
?>
Result View Example
<h4>php-Output_Variables</h4>
<p>From w3schools.com, Experiment by Teeratus_R </p>
<?php
$txt = "W3Schools.com";
echo "I love $txt!";
echo "<br>";
echo "<hr>";
echo "I love " . $txt . "!";
echo "<hr>";
$x = 5;
$y = 4;
echo $x + $y;
?>
Result View Example
<h4>php-Get_the_Type</h4>
<p>From w3schools.com, Experiment by Teeratus_R </p>
<pre>
<?php
var_dump(5);
var_dump("John");
var_dump(3.14);
var_dump(true);
var_dump([2, 3, 56]);
var_dump(NULL);
?>
</pre>
Result View Example
<h4>Assign_Multiple_Values</h4>
<p>You can assign the same value to multiple variables in one line:</p>
<?php
$x = $y = $z = "Fruit";
echo $x;
echo "<br>";
echo $y;
echo "<br>";
echo $z;
?>
Result View Example
Document in project
You can Download PDF file.