ebsearch/results/?solrsort=<keyword>
当我使用$_GET['solrsort']
时,它不会打印关键字。
我尝试过strip_tags,但它不起作用..
还有其他解决方案吗?
提前致谢..
答案 0 :(得分:11)
尝试
echo str_replace(array('<','>'),array('<','>'),$_GET['solrsort']);
或(更好)
echo htmlspecialchars($_GET['solrsort']);
<keyword>
不会显示在呈现的HTML输出中,因为它看起来像一个标记,strip_tags()
会因同样的原因将其完全删除。
答案 1 :(得分:0)
$value=htmlentities($_GET['solrsort']);