Is it possible to have a function with two returns like this:
function test($testvar)
{
// Do something
return $var1;
return $var2;
}
<
I had a similar problem - so I tried around and googled a bit (finding this thread). After 5 minutes of try and error I found out that you can simply use "AND" to return two (maybe more - not tested yet) in one line of return.
My code:
function get_id(){
global $b_id, $f_id;
// stuff happens
return $b_id AND $f_id;
}
//later in the code:
get_id();
var_dump($b_id);
var_dump($f_id); // tested output by var_dump
it works. I got both the values I expected to get/should get. I hope I could help anybody reading this thread :)