Hi I've been playing around with phps filter class getting and have come across a snag with the filter_callback filter.
the following rough bit of code works but shows an error every time
Warning: filter_var() [function.filter-var]: First argument is expected to be a valid callback in /Users/Rob/sites/test_val.php on line 12
class test
{
public function callback($string)
{
$var = filter_var($string, FILTER_CALLBACK, array('options' => $this->foo($string)));
}
public function foo($string){
echo $string;
}
}
$test = new test();
$string = 'test';
$tested = $test->callback($string);
am i calling the function correctly or is there a different way?