php-general | 2000071
Date: 07/01/00
- Next message: Richard Lynch: "[PHP] Re: [PHP-GENERAL] HTTP AUTHENTICATION and LOGOUT Problem"
- Previous message: Richard Lynch: "[PHP] Re: [PHP-GENERAL] ftp_put() problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
In article <3958595B.A3D27234 <email protected>>,
jack <email protected> (Jack Sasportas) wrote:
> I am having problems passing an array to a function.
> I could not find anything on the FAQ's or function info,although what I
> did find made it seem that you could pass an array to a function.
> I get parese errors....
function foo($array){
//This function assumes you pass in an array.
while (list($k, $v) = each($array)){
echo "$k ==> $v<BR>\n";
}
}
$bar = array('a' => 'apple', 'b' => 'banana', 'c' => 'coconut');
foo($bar);
You're probably trying to indicate that the array is an array somehow in
the function header. Don't. PHP is value-typed, not variable-typed: An
array knows it's an array because it is an array, not because some
function header or variable declaration told it it was.
-- Richard Lynch | If this was worth $$$ to you, buy a CD US Customer Support Director | from one of the artists listed here: Zend Technologies USA | http://www.L-I-E.com/artists.htm http://www.zend.com | (this has nothing to do with Zend, duh!)-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Richard Lynch: "[PHP] Re: [PHP-GENERAL] HTTP AUTHENTICATION and LOGOUT Problem"
- Previous message: Richard Lynch: "[PHP] Re: [PHP-GENERAL] ftp_put() problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

