x
 
<!DOCTYPE html>
<html>
<body>
<?php
// 要检查的变量
$str = "<h1>Hello WorldÆØÅ!</h1>";
// 移除 HTML 标签和所有 ASCII 值大于 127 的字符
$newstr = filter_var($str, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH);
echo $newstr;
?>
</body>
</html>