开发者

alternative to htmlspecialchars

We can use htmlspecialchars to stip out html tags.

$name = $_POST['inputbox1'];
$name = htmlspecialchars($name);
echo "Welcome".$name;

Is there开发者_Go百科 another alternative?


PHP's strip_tags(..) might be what you're looking for.


If you're looking to actually strip the tags, check out strip_tags(), but if you're looking for a semi-equivalent function, have a look at htmlentities().


You can use dedicated alternative function called strip_tags.

And remember, php.net is Your friend :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜