Page 1 of 1

functions

Posted: Tue Jan 20, 2004 5:29 pm
by nincha
any one got any ideas of creating a function that returns multiple variables/values??

Posted: Tue Jan 20, 2004 5:31 pm
by markl999

Code: Select all

function foo(){
    $val1 = 'hello';
    $val2 = 'goodbye';
    return array($val1, $val2);
}
list($val1, $val2) = foo();