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 :)
精彩评论