
$tags = array('/<?((?!?>).)*?>/s');
$text = strip_tags(preg_replace($tags, '', $text),'<img><a>'); // cleaning XHTML
Plese ellaborate the situation with a demo link
$tags = array('/<?((?!?>).)*?>/s');
$text = strip_tags(preg_replace($tags, '', $text),'<img><a>'); // cleaning XHTML