PHP 7 Script to Sanitize User Input String & Strip HTML Tags Using FILTER_SANITIZE_STRING Filter In Browser

You are currently viewing PHP 7 Script to Sanitize User Input String & Strip HTML Tags Using FILTER_SANITIZE_STRING Filter In Browser

PHP 7 Script to Sanitize User Input String & Strip HTML Tags Using FILTER_SANITIZE_STRING Filter in Browser

<?php
 
$str= "<h2>Welcome to ETUTORIALSPOINT</h2>
<p>dffdgdfgfd</p><span>sfdsfsdf</span>";
$str_new= filter_var($str, FILTER_SANITIZE_STRING);
echo $str_new;
 
?>

Ranjith

Hi, I'm Manoj a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply