<?php $keyword="Hello(greh) thank(rthvf) you(rthvf)"; $keyword = str_replace("(*)", "", "$keyword");// "*" in stead of (any words) ?? echo "$keyword"; ?> I'd like to print anyone can help me, thank you
You can't do this with str_replace(). You need the power of regular expressions to do it: $keyword = preg_replace('%\([^()]*\)%s', '', $keyword);