Re: Retrieving function values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Nov 14, 2010, at 9:12 PM, Ron Piggott wrote:

I am writing a custom function and I need to be able to retrieve 3 values from it.


To return multiple values, you have to return an array:

	return array($var1, $var2, $var3);

Then at the calling site, you retrieve them with a list construct:

	list ($var1, $var2, $var3) = function_returning_array($param);



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux