Re: Retrieving function values

From: Date: Mon, 15 Nov 2010 10:51:25 +0000
Subject: Re: Retrieving function values
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-309493@lists.php.net to get a copy of this message
On 15 November 2010 03:12, Ron Piggott <ron.piggott@actsministries.org> wrote: > I am writing a custom function and I need to be able to retrieve 3 values from it. > > string_parse_tool ( $string_to_parse ) > > The 3 variables I need to retrieve from the function are: > > $string_to_parse > $string_to_display > $continue_parsing > > I only know how to retrieve 1 variable from a function, not 3.  Could someone help me please? > > Thank you. > > Ron Beside the array() return you could ... function string_parse_tool($string_source, &$string_to_parse, &$string_to_display, &$continue_parsing) { } Now you can use ... string_parse_tool($string_source, $string_to_parse, $string_to_display, $continue_parsing); Depending upon your code, you could drop the first parameter completely, but that would always overwrite the supplied value with the return value. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

« previous php.general (#309493) next »