On Mon, 22 Jan 2001, Abe Asghar wrote:
> Hey there,
>
> is there a way that you can get a function to return multiple values. e.g.:
> {and also how to access them}
>
> function VarTest() {
>
> return $var = 10;
>
> return $var2 = 20;
> }
Functions can only return one variable. However, you can return an array,
which contains as many values as you need.
function vartest()
{
$first = 10;
$second = 20;
return Array($first,$second);
}
Matt
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
- RE: [PHP] Search Engines and PHP Sam Leibowitz
- RE: [PHP] Search Engines and PHP Kristofer Widholm
- RE: [PHP] Search Engines and PHP Ernest E Vogelsinger
- Re: [PHP] Search Engines and PHP Christian Reiniger
- RE: [PHP] Search Engines and PHP Sander Pilon
- RE: [PHP] Search Engines and PHP Kristofer Widholm
- Re: [PHP] Search Engines and PHP Joe Stump
- RE: [PHP] Search Engines and PHP Mark Maggelet
- [PHP] <- functions returning multiple values: -&... Abe Asghar
- Re: [PHP] <- functions returning multiple v... Ignacio Vazquez-Abrams
- Re: [PHP] <- functions returning multiple v... Matt McClanahan
- Re: [PHP] <- functions returning multip... Abe Asghar
- Re: [PHP] <- functions returning multip... Jerry Artman

