MDanz Posted March 21, 2010 Share Posted March 21, 2010 How do i use preg_replace to remove anything both {} and anything inbetween. so e.g. $text = "{test}"; with the preg_replace it should echo empty... how do i do that? Link to comment https://forums.phpfreaks.com/topic/196042-preg_replace-help/ Share on other sites More sharing options...
slurpee Posted March 21, 2010 Share Posted March 21, 2010 How do i use preg_replace to remove anything both {} and anything inbetween. so e.g. $text = "{test}"; with the preg_replace it should echo empty... how do i do that? $str = "{asdf}"; print preg_replace(":\{[^}]+\}:","",$str); Link to comment https://forums.phpfreaks.com/topic/196042-preg_replace-help/#findComment-1029720 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.