ID: 12477
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Closed
Bug Type: Feature/Change Request
Operating System: Linux and SCO
PHP Version: 4.0.6
New Comment:
I was trying to have to walk the array twice.
The following works:
$pagevars = str_replace("$","\\\$",$pagevars);
$page = preg_replace($template,$pagevars,$page);
The reason for using preg_replace is that it does a recursive? replace.
My pagevars array actually has about 40 variables and the intention is to allow
website designers to define their own additional variables that are added to the
template string.
Thanks for your help.
Previous Comments:
------------------------------------------------------------------------
[2001-08-06 17:29:56] [EMAIL PROTECTED]
To QA people (Andy): please don't be hasty.
------------------------------------------------------------------------
[2001-08-06 17:26:23] [EMAIL PROTECTED]
reopened and reclassified as a feature request.
------------------------------------------------------------------------
[2001-08-06 17:26:15] [EMAIL PROTECTED]
If you don't want to use \n or $n substitution, then maybe you are better off using
str_replace()?
------------------------------------------------------------------------
[2001-08-06 17:24:10] [EMAIL PROTECTED]
Is it possible to ask that the this be included as a new feature?
A switch to tell the PCRE engine? to ignore variable substitution?
It would make things a lot easier, I think.
Thanks
------------------------------------------------------------------------
[2001-08-06 12:49:00] [EMAIL PROTECTED]
That's right, you need to escape $ in your replacement strings.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/?id=12477
Edit this bug report at http://bugs.php.net/?id=12477&edit=1
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]