|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
return array ($array1, $array2, etc)
From a function I am trying to use the return statement and return four arrays. If I just try to return one array ie return array($array) all is ok. If I try adding another array ie return array($array1,$array2) I get the error message 'Fatal error: Unsupported operand types in /home/httpd/html/explorers.org.nz/html/report_graph.php on line 342'.
Is it possible to return from a function using array with more than one array in it or am I doing something wrong? One array with several non-arrays works ok (ie return array($array,$foo1,$foo2,$foo3). |
|
#2
|
|||
|
|||
|
RE: return array ($array1, $array2, etc)
Good question. I have never had to do that but I would try something like this:
return array(array($array1), array($array2)); Maybe ... maybe not. |
|
#3
|
|||
|
|||
|
RE: return array ($array1, $array2, etc)
yeah, it's certainly very possible..
perhaps try putting the array into a variable first before returning it.. your error seems to indicate that you're trying to use the returned array incorrectly.. show us some code? |
|
#4
|
|||
|
|||
|
RE: return array ($array1, $array2, etc)
You are right CmdrDats, I now have it working. I have $array4 with some incorrect data which was stuffing things up.
Thanks |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > return array ($array1, $array2, etc) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|