Re: Passing an array as an argument.

From: Date: Tue, 06 Feb 2001 17:59:43 +0000
Subject: Re: Passing an array as an argument.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-38403@lists.php.net to get a copy of this message
Hi April, I suggest you code your array into one string (it depends to the size) then decode it at the other end using your own code. It's the easiest trick to pass the array, compress it into one variable, then extract it at the other end. Any other ideas? ;-) Ahmad ----- Original Message ----- From: April To: PHP General Sent: Tuesday, February 06, 2001 8:48 PM Subject: [PHP] Passing an array as an argument. How do you pass an array as an argument to a function? My code (or at least the important parts): function process_members($asker_rank, $email) { global $database_mysql; mysql_select_db($database_mysql); while (list ($key, $val) = each ($email)) { echo "$key => $val<br>"; } } ######### This will display fine. ######### while (list ($key, $val) = each ($email)) { echo "$key => $val<br>"; } ######### Doing the same thing with the function here returns this error, though. ######## // Warning: Variable passed to each() is not an array or object in lib.inc on line 447 process_members($asker_rank, $total_members, $email); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#38403) next »