Crusader Posted September 26, 2007 Share Posted September 26, 2007 I'm trying to figure out a way to change something like this: [url]http://wordToFind.tld/agawgaw11/agwgag/stuff[/url] into this: [hide][url]http://wordToFind.tld/agawgaw11/agwgag/stuff[/url][/hide] It should search for a specific word, e.g. "wordToFind," in a string but edit the entire string rather than the word. How would I go abouts doing that? Thanks. Link to comment https://forums.phpfreaks.com/topic/70776-preg_replace-and-ereg/ Share on other sites More sharing options...
effigy Posted September 26, 2007 Share Posted September 26, 2007 I think the cleanest approach is to use preg_replace_callback to capture the entire "..." string, then check for the text within the callback. Link to comment https://forums.phpfreaks.com/topic/70776-preg_replace-and-ereg/#findComment-355868 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.