can anybody help me figure out how to return an array from a function call? my function creates an array, and attempts to return it, but when i call $array[][] = function(); it seems to simply return the literal text 'array'. btw, i am trying to return a multidimensional array.
any help would be appreciated
There are no restrictions on returning arrays in PHP. $newArray = thatfunction();
function thatfunction() { return array(array(1, 2, 3), array(4, 5, 6));
}
should work. Try a print_r($newArray); to test the value returned
the line $array[][]=function(); would place the multidimensional array returned from function() into the next element of $array[][]. Do that and you'd get a four dimensional array.
Try $array = function();
Still, that doesn't seem to be your problem. Try dumping the array before it is returned. There might be an issue before then.
ahh yess.. many thanks my guru-ish friend
hey, that makes sense too!! and gives me a bit more understanding of arrays. thanks ben