return multiple values from a function
<?php
function retrieve_user_profile() {
$user[] = "Jason";
$user[] = "jason@example.com";
$user[] = "English";
return $user;
}
list($name,$email,$language) = retrieve_user_profile();
echo "Name: $name, email: $email, preferred language: $language";
?>
Related examples in the same category