Re: Retrieving function values

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

 



On 15 November 2010 03:12, Ron Piggott <ron.piggott@xxxxxxxxxxxxxxxxxx> 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

-- 
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