Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

Function return more than one value

Tue Oct 28, 2008 2:00 pm

Code:

<?php
   
function retrieve_user_profile() {
      
$user[] = "A";
      
$user[] = "[email protected]";
      
$user[] = "English";
      return
$user;
   }
   list(
$name,$email,$language) = retrieve_user_profile();
   echo
"Name: $name, email: $email, preferred language: $language";
?>




Post a reply
  Related Posts  to : Function return more than one value
 readLine() return value     -  
 return false; questions     -  
 what will return by void main()     -  
 Return all the keys of an array     -  
 return file path after encoded using UTF-8 from URL     -  
 Return words count in a string     -  
 Return all the values of an array using array_values     -  
 read() return when it has reached the end of a file     -  
 Preventing backspace key from return back     -  
 Return an array with elements in reverse order     -  

Topic Tags

PHP Functions