samedi 5 décembre 2020

I cant understand why the output is 30

$arr=array ("x"=>array (1,2,3),"y"=>5);
$y=0;
foreach ($arr as $x)
if(is_array ($x))
foreach ($x as $value)
$y+=$value;
else
$y*=$x;
echo  $y;

Aucun commentaire:

Enregistrer un commentaire