Best you can do is return an array and call it like this: function myfunction($a,$b) { $r[0] = $a + 1; $r[1] = $b + 1; return $r; }
list($c,$d) = myfunction(10,20); Adapt to your needs. ---John Holmes... ----- Original Message ----- From: "sanjay" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, April 29, 2002 10:11 AM Subject: [PHP] return multiple value from function > Hi List, > > I am new to php programming and wanted to know if it is possible to return > multiple value from a function like cgi programs. > How can I get the following result using php. > > ($var1, $var2) = myfunction($a,$b); > > > function myfunction($c,$d) > { > // code > // code > return ($e,$f); > } > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php