PHP Tutorial : Multiple string replace with str_replace

Well, I already writed about str_replace php function but this tip is very usefull. To recap, the function it’s used to replace a string by using three paramaters : $stringToSearch, $stringToReplace, $intoString. I showed you how to use it in single operations but we can use it for multiple replaces in one place, by using arrays :

I have to say this multiple replace “trick” is a very nice one!

See ya soon!

Tagged with: , , , , , ,
Posted in Basic PHP

Leave a Reply

Your email address will not be published. Required fields are marked *