Is it possible to have a function with two returns like this:
function test($testvar)
{
// Do something
return $var1;
return $var2;
}
<
The answer that's given the green tick above is actually incorrect. You can return multiple values in PHP, if you return an array. See the following code for an example:
This code is actually copied from the following page on PHP's website: http://php.net/manual/en/functions.returning-values.php I've also used the same sort of code many times myself, so can confirm that it's good and that it works.