change to:
list( $policy_num, $policy_year, $application_reference ) = explode( "--",
$policy ); 

-----Original Message-----
From: Chris Boget [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 11:22 AM
To: PHP General
Subject: [PHP] list(), each()

Ok, I've got to be doing something wrong here.  I've been
beating my head up against the wall for some time and I 
just cannot figure out what it is.  Before I say it's a bug with
list(), could someone tell me what I'm doing wrong?


$policy = "1016726726--1--1016643856";

// problematic
list( $policy_num, $policy_year, $application_reference ) = each( explode(
"--", $policy )); 
echo "list( $policy_num, $policy_year, $application_reference ) = each(
explode( \"--\", $policy )); <br>\n";

// fine
$policy = explode( "--", $policy );
echo $policy[0] . "<br>\n";
echo $policy[1] . "<br>\n";
echo $policy[2] . "<br>\n";


Why isn't list() assigning the value properly?  For the first echo
statement, I'm

"list( 0, 1016726726, ) = each( explode( "--", 1016726726--1--1016643856

but the others, where I'm echoing out the individual elements, it's working

What's going on?


PHP General Mailing List (
To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to