how to add two variables in php code example
Example 1: addition in php
<?php
$x=15;
$y=30;
$z=$x+$y;
echo "Sum: ",$z;
?>
Example 2: assign multiple variables php
[$var1, $var2, $var3, $var4, $var5] = array(1, 2, 3, 4, 5);
<?php
$x=15;
$y=30;
$z=$x+$y;
echo "Sum: ",$z;
?>
[$var1, $var2, $var3, $var4, $var5] = array(1, 2, 3, 4, 5);