04-24-2009, 02:15 AM
|
#11 (permalink)
|
|
The Gregarious
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
|
Quote:
Originally Posted by smrtalex
Wow. Thanks! I have tried allworknoplay's suggestion to no avail (meaning it is not returning any values). And I'm not quite sure where to put your code and how to change it to work with my script. Can you help me there? 
|
I got it to work this way...
Code:
<?
function info($user) {
//simulate successful DB results
$vb["customerFirstName"] = "John";
$vb["customerLastName"] = "Smith";
$vb["customerEmailAddress"] = "none@none.com";
return array(
$vb["customerFirstName"],
$vb["customerLastName"],
$vb["customerEmailAddress"]
);
}
$user = "john";
list($first_name, $last_name, $email) = info($user);
echo "$first_name, $last_name, $email";
?>
I get the output:
John, Smith, none@none.com
|
|
|
|