Re: returning an array
| From: | Ignacio Vazquez-Abrams | Date: | Thu, 11 Jan 2001 19:19:23 +0000 |
| Subject: | Re: returning an array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-34067@lists.php.net to get a copy of this message | ||
On Thu, 11 Jan 2001, jim davis wrote:
> Hello again! Ok, so I will give up the idea of calling a function from
> one php page and having that function return its value to another php
> page... BUT I was looking at the "php handbook" and found that I could
> return an array! this is the example thay gave:
>
> function small_numbers() {
> return array (0, 1, 2);
> }
> list ($zero, $one, $two) = small_numbers();
>
> ok, that works fine for small arrays, but what if I had an array that
> was 20 or more elements big? Is there a way of returning a generic
> sized array? such as 'return array ($var[]);' ? I tried it, and it
> yelled at me, so I know that the above syntax is wrong, but is there an
> "easier" way?
> Thanks!
>
> -Jim
>
Have you tried 'return ($var)'?
--
Ignacio Vazquez-Abrams <ignacio@openservices.net>