$string = str_ireplace('target=\"_blank\"', '', $string); $string = str_ireplace(\"target='_blank'\", '', $string);