php value and 2 sum code example Example: sum two numbers in php <?php $x=10; $y=20; $z = $x + $y; echo "Sum of x and y : ". $z; ?>