Quote:
Today at 12:55 PM filburt1 said this in Post #4
$1 isn't a legal variable name, how can anything return it?
|
Yes I understand that, but can you not use those variables in preg_replace() ?
I'm actually taking apart a piece of text using:
PHP Code:
$text = preg_replace("#<if \((.+?)\)>(.+?)(<else>(.+?)</else>)</if>#is", xscondition('$1', '$2', '$3'), $text);
Now, I understand that the reason it is returning "$1" is because of the use of the single quotes, however I've tried most things, with trying to pass preg_replace() variables onto a function, and it just won't work.
Thankyou,
Alcar...