|
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 |
gusto Smarty Rookie
Joined: 11 Jun 2008 Posts: 14
|
Posted: Wed Jun 11, 2008 2:14 pm Post subject: Smarty Replace Quotes Problem |
|
|
Hello,
I have a problem replacing quotes.
How can I do this I tried:
{$variable.NAME|escape|trim|lower|replace:"%22":""| etc
and even
{$variable.NAME|escape|trim|lower|replace:""":""| etc
they get smarty errors.
Any ideas please for replacing " and ' quotes? please |
|
Back to top |
|
Celeb Administrator
Joined: 17 Apr 2007 Posts: 1025 Location: Vienna
|
Posted: Wed Jun 11, 2008 2:24 pm Post subject: |
|
|
Have you tried this?
Code: | {$variable|replace:"\"":"'"} |
_________________ Darn computers always do what I tell them to instead of what I want them to do. |
|
Back to top |
|
gusto Smarty Rookie
Joined: 11 Jun 2008 Posts: 14
|
Posted: Wed Jun 11, 2008 3:29 pm Post subject: Hello thanks for the reply however that did not work for me |
|
|
Hello thanks for the reply however that did not work for me. Any other ideas please? There is no error with that but it does not replace " quotes. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Wed Jun 11, 2008 3:36 pm Post subject: |
|
|
What's about
Code: | {$variable|replace:'"':"'"} |
|
|
Back to top |
|
gusto Smarty Rookie
Joined: 11 Jun 2008 Posts: 14
|
Posted: Thu Jun 12, 2008 6:41 am Post subject: |
|
|
I finally figured it out!
replace:"'"|replace:""":""| works to replace ' and " quotes respectively.... finally!
thanks for everyones help as that ruled many things out
Last edited by gusto on Thu Jun 12, 2008 6:42 am; edited 1 time in total |
|
Back to top |
|
gusto Smarty Rookie
Joined: 11 Jun 2008 Posts: 14
|
Posted: Thu Jun 12, 2008 6:41 am Post subject: |
|
|
gusto wrote: | I finally figured it out!
replace:"''"|replace:""":""| works to replace ' and " quotes respectively.... finally!
thanks for everyones help as that ruled many things out |
|
|
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
|