php var array var 350 rand 25 var 250 var rand 25 var 150 var var rand

1
2
3
4
5
6
7
8
<?php
$var = array();
$var[1] = 350 - rand(1,25);
$var[2] = 250 - $var[1] - rand(1,25);
$var[3] = 150 - $var[1] - $var[2] - rand(1,25);
$var[4] = 50 - ($var[1]+$var[2]+$var[3]);
echo $var[1].' + '.$var[2].' + '.$var[3].' + '.$var[4].' = '. array_sum($var);
?>