Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 2000051

[PHP3] array_walk errors From: Darren Lindley (DLindley <email protected>)
Date: 05/02/00

im having aproblem when using array_walk with php 3.0.16 (win98)

eg consider an example taken right out of the manual (pdf verison):

<?php

$fruits = array("d"=>"lemon","a"=>"orange","b"=>"banana","c"=>"apple");

function test_print( $item2, $key ) {
  echo "$key. $item2<br>\n";
}

array_walk( $fruits, 'test_print' );

?>

what i get is:

Warning: Missing argument 2 in call to test_print() in
E:\Internet-Junk\homepage\dazweb\test.php3 on line 6
. lemon

Warning: Missing argument 2 in call to test_print() in
E:\Internet-Junk\homepage\dazweb\test.php3 on line 6
. orange

Warning: Missing argument 2 in call to test_print() in
E:\Internet-Junk\homepage\dazweb\test.php3 on line 6
. banana

Warning: Missing argument 2 in call to test_print() in
E:\Internet-Junk\homepage\dazweb\test.php3 on line 6
. apple

ive tried " instead of ' with the same effect.

any ideas?

-- 
PHP 3 Mailing List <http://www.php.net/>
To unsubscribe, send an empty message to php3-unsubscribe <email protected>
To subscribe to the digest, e-mail: php3-digest-subscribe <email protected>
To search the mailing list archive, go to: http://www.php.net/mailsearch.php3
To contact the list administrators, e-mail: php-list-admin <email protected>