PHP: Is it possible to return multiple values from a function?

spacemud picture spacemud · Aug 27, 2010 · Viewed 30.3k times · Source

Is it possible to have a function with two returns like this:

function test($testvar)
{
  // Do something

  return $var1;
  return $var2;
}

If so, how would I be able to get each return separately?

Answer