RE: [PHP] return multiple value from function

2002-04-29 Thread Cal Evans
no, it's not possible to do it that way. If you need to return multiple values from a function, your best bet is to return an array or some kind of record structure. By design, in almost all languages, functions only return a single value. =C= * * Cal Evans * Journeyman Programmer *

Re: [PHP] return multiple value from function

2002-04-29 Thread Richard Emery
?php function funca($a,$b) { $q=$a; $w=$b; return array($w,$q); } $e=123; $r=456; list($z,$x) = funca($e,$r); print $z, $x\n; ? - Original Message - From: sanjay [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 29, 2002 9:11 AM Subject: [PHP] return multiple value from

Re: [PHP] return multiple value from function

2002-04-29 Thread Jason Wong
On Monday 29 April 2002 22:11, sanjay wrote: 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)

Re: [PHP] return multiple value from function

2002-04-29 Thread 1LT John W. Holmes
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

Re: [PHP] return multiple value from function

2002-04-29 Thread sanjay
Thnaks. It solved my problem. sanjay - Original Message - From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 29, 2002 7:50 PM Subject: Re: [PHP] return multiple value from function On Monday 29 April 2002 22:11, sanjay wrote: Hi List, I am new to php