Re: Function: return multple values

From: Date: Mon, 23 Sep 2002 15:05:25 +0000
Subject: Re: Function: return multple values
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-117275@lists.php.net to get a copy of this message
You can only as an array: function calculate_money($sum) { // some hanky panky calculations $myArr[] = $type; $myArr[] = $amount; return $myArr; } or shorter: function calculate_money($sum) { return array($type, $amount); } "Faisal Abdullah" <faisal@magnifix.com.my> wrote in message news:FEEEKEGJABPMFPOCEEONEEOHCAAA.faisal@magnifix.com.my... > Hi people. > Is it possible to return multiple values in a function. > For instance, i want to do something like this: > > function calculate_money($sum) > { > // some hanky panky calculations > return $type; > return $amount; > } > > Thanks! > > Sincerely, > Faisal > > ______________________________________ >

« previous php.general (#117275) next »