- preg_replace_callback: documentation ( source)
<?php
class Example {
private function callback() {
return "Test";
}
public function doSomething() {
return preg_replace_callback('/./', array($this, 'callback'), 'foo');
}
}
$e = new Example;
echo $e->doSomething();