Darkmatter5 Posted July 23, 2008 Share Posted July 23, 2008 Is there a function to remove a specified sting of text from a string variable? Link to comment https://forums.phpfreaks.com/topic/116246-remove-specified-string-of-text-from-a-variable/ Share on other sites More sharing options...
GingerRobot Posted July 23, 2008 Share Posted July 23, 2008 str_replace()? Link to comment https://forums.phpfreaks.com/topic/116246-remove-specified-string-of-text-from-a-variable/#findComment-597709 Share on other sites More sharing options...
discomatt Posted July 23, 2008 Share Posted July 23, 2008 preg_replace() as well Link to comment https://forums.phpfreaks.com/topic/116246-remove-specified-string-of-text-from-a-variable/#findComment-597710 Share on other sites More sharing options...
Darkmatter5 Posted July 23, 2008 Author Share Posted July 23, 2008 Thanks, it works great! Link to comment https://forums.phpfreaks.com/topic/116246-remove-specified-string-of-text-from-a-variable/#findComment-597716 Share on other sites More sharing options...
GingerRobot Posted July 23, 2008 Share Posted July 23, 2008 preg_replace() as well If you're just replacing known text, then you wouldn't want to use regular expressions. Less efficient. Link to comment https://forums.phpfreaks.com/topic/116246-remove-specified-string-of-text-from-a-variable/#findComment-597718 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.