preg_replace on array with "E (PCRE_DOLLAR_ENDONLY)" modifier
| From: | Grant Walters | Date: | Tue, 24 Apr 2001 00:57:09 +0000 |
| Subject: | preg_replace on array with "E (PCRE_DOLLAR_ENDONLY)" modifier | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-49974@lists.php.net to get a copy of this message | ||
Hi,
I'm having problems stopping preg_replace from losing $ signs and following text when replacing
with array variables. I am trying
to use the E modifier and keep getting:
"Warning: Unknown modifier 'E' in script.WEB.php3 on line 413"
$template=array(
"/({PAGETOP})/E",
"/({PAGEMIDDLE})/E",
"/({PAGEBOTTOM})/E"
);
$pagevars=array(
"PAGETOP" => $pagetop,
"PAGEMIDLE" => $pagetop,
"PAGEBOTTOM" => $pagenavbar,
);
Text from assorted sources such as database records or external files are placed into the variables
$pagetop ...
$page = "{PAGETOP}{PAGEMIDDLE}{PAGEBOTTOM}";
$page = preg_replace($template,$pagevars,$page);
Other modifiers seem to be accepted. Any help appreciated.
Regards
Grant Walters
Brainbench 'Most Valuable Professional' for Unix Admin
Walters & Associates, P O Box 13-043 Johnsonville, Wellington, NEW ZEALAND
Telephone: +64 4 4765175, CellPhone 025488265, ICQ# 23511989