reference a function in a class from array_walk()
| From: | Thomas Hochstetter | Date: | Sat, 21 Jun 2003 17:24:26 +0000 |
| Subject: | reference a function in a class from array_walk() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-152402@lists.php.net to get a copy of this message | ||
Hi guys.
I want to call this generic echo function within a class, but have
trouble referencing the output function with $this-> .
Any suggestions? Maybe there is a better solution to this?
This is within a class:
[snip]
# generic WALK functions
function walkit($array)
{
array_walk($array,"$this->output"); //not
working
}
function output($item,$key)
{
echo "$key. $item<br />\n";
}
thomas