Hrms. Got a small problem.
I'm now using functions on a regular basis, but I've come to another
sticking point with them: returning multiple variables from the function...
Here's a really quick example (nothing to do with what I intend to use the
functions for):
function CUP
On Mon, Feb 12, 2001 at 09:13:09PM -, James, Yz wrote:
What if I wanted to "return" more than one variable from the function? And
how would I assign it a name? Like the actual variable, or is that just not
possible?
I've tried
return $var1,$var2;
You're on the right track.
return
An approach that many people take is to simply have a function return success
or failure, and have any data that needs to be propogated upwards assigned to
pass-by-reference parameters. I like this approach because it removes any
question as to what a function returns. One drawback is that it
To: [EMAIL PROTECTED]
Sent: Tuesday, February 13, 2001 2:43 AM
Subject: [PHP] returning multiple variables from a function?
Hrms. Got a small problem.
I'm now using functions on a regular basis, but I've come to another
sticking point with them: returning multiple variables from the
function..
4 matches
Mail list logo