Re: how to create a function and return two parameters????

From: Date: Wed, 19 Nov 2003 21:06:24 +0000
Subject: Re: how to create a function and return two parameters????
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-170345@lists.php.net to get a copy of this message
Ummm, look like I'll stick with number two. Didn't know about the "&" value to pass value back and forth in PHP.... Thanks, Scott F. "Chris W. Parker" <cparker@swatgear.com> wrote in message news:001BD19C96E6E64E8750D72C2EA0ECEE2B8335@ati-ex-01.ati.local... 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/

« previous php.general (#170345) next »