|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
ferre Smarty Rookie
Joined: 07 Jul 2003 Posts: 28
|
Posted: Wed Aug 20, 2003 10:49 am Post subject: eregi_replace |
|
|
i wanna to change
this {$xxx}
to this {literal}{$xxx}{/literal}
$message = eregi_replace("\\{$([^\\[]*)\\}\\","{literal}{$\\1}{literal}",$message);
but can't run , plz help ....sorry for posting here,its seems about php |
|
Back to top |
|
andre Smarty Pro
Joined: 23 Apr 2003 Posts: 164 Location: Karlsruhe, Germany
|
Posted: Wed Aug 20, 2003 11:00 am Post subject: |
|
|
You could try this:
Code: | $message = preg_replace('/\{\$(\w+)\}/', "{literal}{\$\\1}{/literal}", $message); |
by the way: preg_replace (like used in my code above) is faster than eregi_replace |
|
Back to top |
|
ferre Smarty Rookie
Joined: 07 Jul 2003 Posts: 28
|
Posted: Thu Aug 21, 2003 5:30 am Post subject: |
|
|
it's work now , thanks !! |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|