Re: sub function and variables
| From: | Niklas Brunlid | Date: | Tue, 08 Aug 2000 13:36:54 +0000 |
| Subject: | Re: sub function and variables | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-10658@lists.php.net to get a copy of this message | ||
Martin Thoma wrote:
>
> Hello !
>
> With "return" you can return one value from a function. What's the best
> way to return MORE results ? Is it possible to give them back to
> paramters like in C ? (I mean something like
>
> function DoSomething($result1, $result2)
>
> where after a call of DoSomething($a, $b) the results are stored in $a
> and $b).
>
> Is it only possible to use classes or globals for that purpose ?
Passing by reference should do the trick:
function DoSomething(&$result1, &$result2)
/Niklas