Returning two values from a function

Viewed 92642

Is it possible to return two values when calling a function that would output the values?

For example, I have this:

<?php
    function ids($uid = 0, $sid = '')
    {
        $uid = 1;
        $sid = md5(time());

        return $uid;
        return $sid;
    }

    echo ids();
?>

Which will output 1. I want to chose what to ouput, e.g. ids($sid), but it will still output 1.

Is it even possible?

7 Answers
Related