Posted by Sergej Andrejev on 11/05/05 02:23
Parrot wrote:
> I am trying to program a function to return a 2 dimensional array, but
> it's not working. I reduced the return value to 1 dimension and
> tested that to make sure that the problem wasn't elsewhere. It had no
> problem when the array was 1 dimensional.
>
> Is there something different I need to do in order to return a 2
> dimensional array from a function?
Are you shore you don't want to pass array by reference like this:
<?
function r_array(&$array){
$array[0][0] = "a";
$array[0][1] = "b";
$array[1][0] = "c";
$array[1][1] = "d";
}
r_array($array2);
print_r($array2);
?>
Navigation:
[Reply to this message]
|