To further amplify, what you can do is have the function return an array. And yes, if you need to, it's a good idea. For example, that's how many of the dbms-results functions work: mysql_fetch_row(), pg_fetch_row(), etc.
Also, the calling function can either simply receive the return value as an array, or, if that's not convenient, use list() to gather together a group of scalars, e.g.:
list($name, $userid, $last_on) = pg_fetch_row( $result, $row_no );
This last is actually a pet peeve of mine: you frequently see people doing unnecessary shuffling of data like this:
$data = pg_fetch_array( $result );
$name = $data['name'];
$userid = $data['userid'];
$last_on = $data['last_on'];
and then of course $data is never referenced again. :-(