RE: [PHP] how to create a function and return two parameters????
| From: | Chris W. Parker | Date: | Wed, 19 Nov 2003 20:05:23 +0000 |
| Subject: | RE: [PHP] how to create a function and return two parameters???? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-170341@lists.php.net to get a copy of this message | ||
Scott Fletcher <mailto:scott@abcoa.com>
on Wednesday, November 19, 2003 12:07 PM said:
> I wanted to know how do I return two parameters within a
> function. I'm not having much luck with it. I kept getting errors...
[snip]
> return $strResponse_XML,$strResponse_HTML;
That's because it doesn't work like that. :)
Three solutions:
1. pass a value by reference i.e. function myfunction(&$value) {} AND
return something
2. don't return anything and pass both values by reference
3. stick both values in an array and return the array (easiest)
Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/