Re: More than one values returned?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



<?php
$in = 4;
calcpows($in, $pow2, $pow4);
echo "in = $in pow2=$pow2 pow4=$pow4";

// define return fields as &$...
function calcpows($in, &$pow2, &$pow4)
{
  $pow2 = $in * $in;
  $pow4 = $pow2 * $pow2;
}
?>

HTH

----- Original Message ----- From: "Teck" <tek.katu@xxxxxxxxx>
To: <php-general@xxxxxxxxxxxxx>
Sent: Tuesday, February 19, 2008 1:31 AM
Subject:  More than one values returned?


Hi,


Is it possible to "return" more than one values in PHP?

return $x;
return $y;

They don't work for me.

-T

--
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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux