|
Posted by Malcolm Dew-Jones on 11/03/05 21:57
Parrot (me@myplace.com) TOP POSTED:
: I definitely created a 2D array, I tested it within the function.
Let's see the code.
: Your example doesn't give an example of creating a 2D array and I
It looks like an array of arrays to me. Perhaps you mean something else
when you say "2D array".
: don't see any variable names in your return statement. Could you
: please expand on that?
What does the name of the variable have to do with this? He returns a php
"thing" which is an array of arrays. You could have assigned that "thing"
to a variable first if you wished, and then returned the value of the
thing by using the variable. I will admit I can not test that at the
moment, but find it hard to imagine it doesn't work as I expect...
$two_D_array = array(array());
return $two_D_array;
We need to see your code to debug the error or misunderstanding.
: On Thu, 03 Nov 2005 14:48:19 -0500, JDS <jeffrey@example.invalid>
: wrote:
: >On Thu, 03 Nov 2005 12:10:55 -0500, Parrot wrote:
: >
: >> Is there something different I need to do in order to return a 2
: >> dimensional array from a function?
: >
: >Yes. Create a 2-D array inside the function. Return it.
: >
: >As simple as this:
: >
: >function get_2d_array(){
: > return array(array());
: >}
: >
: >Maybe your function is not *creating* a 2D array?
--
This programmer available for rent.
Navigation:
[Reply to this message]
|