Answers for "remove html special chars php"

PHP
0

Remove Special Character in PHP

phpCopy<?php
function RemoveSpecialChar($str)
{
    $res = preg_replace('/[0-9\@\.\;\" "]+/', '', $str);
    return $res;
}
$str = "My name is  hello and email [email protected];";
$str1 = RemoveSpecialChar($str);
echo "My UpdatedString: ", $str1;
?>
Posted by: Guest on April-23-2021
0

Remove special characters in php

function removeSpecialChar($string) 
		{
			$string = strtolower($string);
			$string = preg_replace('/[^\da-z ]/i', '', $string);// Removes special chars.
			$string = str_replace(' ', '-', $string); // Replaces all spaces with underscore.
			return strtolower($string);
		}
Posted by: Guest on December-27-2021

Code answers related to "remove html special chars php"

Browse Popular Code Answers by Language