<?php
$str = 'today I \'ll learn PHP and the day with awsome.';
$str1 = 'This is a bad command so donot put here : del c:\\*.*';
echo RemoveSpecialChar($str);
echo "<br/>";
echo RemoveSpecialCharinphp($str1);
function RemoveSpecialCharinphp($str)
{
$string1= preg_replace('/[0-9\@\.\;\""]+/', '', $str);
return $string1;
}
?>
Out put of the code
1) today I 'll learn PHP and the day with awsome
2) This is a bad command so donot put here : del c:\**
Thanks you for commenting your questions. I will see question and respond you.