samedi 4 avril 2015

Replace quotes with open and close html tags

I have the following string:



'something can go here' and there some more text 'then some more here'


That I would like to become:



<pre>something can go here</pre> and there some more text <pre>then some more here</pre>


I know you can do:



str_replace($replace, $with, $from);


But as both ends are the same symbol thats not going to work, what is the best way to get around this?


Aucun commentaire:

Enregistrer un commentaire