开发者

alternative to htmlspecialchars

开发者 https://www.devze.com 2023-04-07 20:51 出处:网络
We can use htmlspecialchars to stip out html tags. $name = $_POST[\'inputbox1\']; $name = htmlspecialchars($name);

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

精彩评论

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

关注公众号