private function sanitizeContent($content) { // replace everything between opening and closing php and asp tags $content = preg_replace('/<[?%].*[?%]>/', '', $content); // replace opening and closing php and asp tags return str_replace(['<?', '<%', '?>', '%>'], '', $content); }