<?php header("content-type:text/html;charset=utf-8"); $script = "以下內容不顯示:<script type='text/javascript'>alert('cc');</script>"; $pattern = '/<script[^>]*?>.*?<\/script>/si'; echo preg_replace($pattern, "指令碼內容", $script);//以下內容不顯示:指令碼內容 ?>
更多:https://www.shanhubei.com/archives/55202.html