preg_replace

From: Date: Mon, 13 Mar 2000 03:59:24 +0000
Subject: preg_replace
Groups: php.dev 
Request: Send a blank email to php-dev+get-16736@lists.php.net to get a copy of this message
class test{ var var1; function printit(){ echo preg_replace("/DATA_([A-Z]+)/e", "$this->showX('\\1',\"$this->var1\")", $inputstring); // doesn't work echo preg_replace("/DATA_([A-Z]+)/e", "showX('\\1')", $inputstring); // works great } function showX($param){ if ("NAME" == $param) return $this->var1; } } This doesn't work, ideas? It breaks if i pass in $this->anyfunction() works great with a function that's not defined in the current class. Also doesn't work if var1 is a complex type. Thanks Andrew

« previous php.dev (#16736) next »