Hi there.
I'm trying to do a translate kinda thing with PHP like pornalize where you type in a URL and it will replace text in the web site with 'other words'.
What should I be using and what's the most efficient way?
Been wanting to do this for ages but always tend to drain resources doing it very very long ways.
Any help would be great. Darren
prepare two arrays, one with words to replace, the second with words to replace with and do preg_replace on the text
eg $from=array("/porn/","/sex/"); $to=array("beeep","nothing"); echo preg_replace($from,to,$your_html_page);
This might replace text within tags though. This is what i'm trying to avoid.