Is it possible to have a function with two returns like this:
function test($testvar) { // Do something return $var1; return $var2; }
Some might prefer returning multiple values as object:
function test() { $object = new stdClass(); $object->x = 'value 1'; $object->y = 'value 2'; return $object; }
And call it like this:
echo test()->x;
Or:
$test = test(); echo $test->y;