$content = $_POST['content']; $pattern = '/<(form|script|iframe)[^>]*>(.*?)<\/\1>/is'; preg_match_all($pattern, $content, $match); if(isset($match[1]) && !empty($match[1])){ echo '含'; }else{ echo '不含'; }