note 40283 added to function.array-walk
| From: | nospam0ATmassartDOTorg at rn2 dot php dot net | Date: | Fri, 27 Feb 2004 12:47:11 +0000 |
| Subject: | note 40283 added to function.array-walk | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-65878@lists.php.net to get a copy of this message | ||
Martin Lucas-Smith is wrong, it's possible to call a static method using this syntax :
<?php
// the class with its method
class testClass
{
function testMethod($string)
{
echo "array value = " . $string . "<br/>";
}
}
// creates the array
$testArray = Array();
$testArray[]="test1";
$testArray[]="test2";
$testArray[]="test3";
// call the static class method for each array item
array_walk( $testArray, array( testClass,'testMethod') );
?>
----
Manual Page -- http://www.php.net/manual/en/function.array-walk.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40283
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40283&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40283&report=yes
Search -- http://master.php.net/manage/user-notes.php