is it possible to return an array from a user function? example:
something () { $test=array(5,6); return $test; } something()[0]; //returns 5? something()[1]; //returns 6?
if not, is there another way i can do it?
thanks! nate
like this....
function dostuff () { return array ("abc", "def", "geh"); } list ($first, $second, $third) = dostuff; echo $first; echo $second; echo $third;
Or you can just do:
something () { $test=array(5, 6); return_$test; } $newarray = something(); print $newarray[1];
Thanks guys!