如何从php用户定义函数返回多于1个可变数据

I am calling mail_data function and passing userid

function mail_data($userid)
{
................
................
$query="select * from table where userid='$userid'";
$rs=mysql_query($query,$con);
$row=mysql_fetch_array($rs)
$fname=$row['fname'];
$lname=$row['lname'];
$mail=$row['mail'];
//i want to return 3 variables from here
}

Is there any method to return more then variable from any function ?

You can do this:

return $row;

OR

$data['fname'] = $row['fname'];
$data['lname'] = $row['lname'];
$data['mail'] = $row['mail'];

return $data;

Return statement returns value for only single variable at a time.

So for returning values for multiple variables at a time you need to define an array variable for holding multiple values and return that array variable from the function