Regex PREG_REPLACE_EVAL question
Posted: Sun Dec 07, 2008 6:06 am
Hi, am quite new to PHP and I am having a problem with a regular expression.
I have a expression with where $pattern = "/something/e"
and i am trying to evaluate preg_replace($pattern, "$this->myInnerClassFunction(\\0)",$replaceMe)
and it is not finding the function myInnerClassFunction since i am using $this. It would be great if someone could tell me what the proper syntax for using $this-> in a preg_replace. Thanks in advance for the help.
I have a expression with where $pattern = "/something/e"
and i am trying to evaluate preg_replace($pattern, "$this->myInnerClassFunction(\\0)",$replaceMe)
and it is not finding the function myInnerClassFunction since i am using $this. It would be great if someone could tell me what the proper syntax for using $this-> in a preg_replace. Thanks in advance for the help.