Code: Select all
<?php
class testclass {
function match($matches) {
...
}
function replace() {
preg_replace_callback(...);
}
}
?>
Cheers, Darkzaelus
Moderator: General Moderators
Code: Select all
<?php
class testclass {
function match($matches) {
...
}
function replace() {
preg_replace_callback(...);
}
}
?>
Code: Select all
class testclass {
function match($matches) {
...
}
function replace() {
preg_replace_callback("/.../", array($this, "match"), "...")
}
}
Code: Select all
$arr=preg_replace_callback('/\\{.*?\\}/is',array($this,'match'),$arr);
Code: Select all
public function match($matches) {
echo 'true';
}
Code: Select all
class PseudoView{
public function match($matches) {
echo 'true';
}
public function test() {
$arr='{test}';
$arr=preg_replace_callback('/\\{(.*?)\\}/is',array($this,'match'),$arr);
}
}
Code: Select all
$callback=array(($this|'parent class'), 'parent_class_name::function');