Answers for "pass address of array in php"

PHP
0

pass address of array in php

function foo(&$array)
{
    $array[3]=$array[0]+$array[1]+$array[2];
    return $array;
}

$waffles[0]=1;
$waffles[1]=2;
$waffles[2]=3;
foo($waffles);

echo $waffles[3];
Posted by: Guest on March-20-2021

Browse Popular Code Answers by Language