PHP正则匹配 form iframe script 开发技巧

lecms 6月前 278

$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 '不含';
}
最新回复 (0)
返回
发新帖