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