Function return more than one value
<?php
function retrieve_user_profile() {
$user[] = "A";
$user[] = "A@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