I am getting the following message:
[07-May-2003 17:41:20] PHP Warning: array_filter() [<a href='http://www.php.net/function.array-filter'>function.array-filter</a>]: The second argument, 'odd', should be a valid callback in .../t.php on line 11
for the following code:
<?php
class asdf {
function odd($var) {
return ($var % 2 == 1);
}
function testthis() {
$array1 = array(6,7,8,9,10,11,12);
return array_filter($array1, "[B]odd[/B]");
}
}
$x = new asdf();
print_r($x->testthis());
?>
So how do you refer to a callback from within a class? I've tried using "asdf::odd", "this->odd", "$this->odd" as the callback parameter, but I get the same message in each case.
Anybody know??
Thanks.