php有办法实现像这样输出js代码?
比如有个变量值是这样的
$a = "<script>window.location.href='http://xxx.com';</script>";
<script>window.location.href='http://xxx.com';</script>
<script>window.location.href='http://xxx.com';</script>
$a = "<script>window.location.href='http://xxx.com';</script>";$b = htmlspecialchars($a);echo $b;//result: <script>window.location.href='http://xxx.com';</script> //source: <script>window.location.href='http://xxx.com';</script>