php - Smarty: cannot replace string


I'm new to Smarty and I have a variable which contains a URL and I'm trying to perform a replace operation on it, to show This is what I have, but it's not working.

{$theurl | replace: 'http://' :'http://m.'}

I also tried assigning the $theurl to a second variable and perform the replacement there, but I have no luck.

I also tried escaping the slashes, replacing http for xxx, and nothing works.

I took a look here for reference:




Can you give us some more information on the variable itself? How about you use a var_dump to show the current value of the variable:


Why are you using spaces in the smarty syntax, maby that is the problem:


People are also looking for solutions to the problem: php - image resizing tinymce how to?


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.