Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Remove Special Char PHP

<?php
function RemoveSpecialChar($str)
{
    $res = preg_replace('/[0-9@&^\%()#$!][}{*'".;" "]+/', ' ', $str);
    return $res;
}
$str = "My name is  hello and)(**&&^%$$#@! em[ail he}ll'o.world{59}8@gmail.com;";
$str1 = RemoveSpecialChar($str);
echo $str1;
?>
Source by www.delftstack.com #
 
PREVIOUS NEXT
Tagged: #Remove #Special #Char #PHP
ADD COMMENT
Topic
Name
3+7 =