Answers for "remove symbol 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 Character in PHP

phpCopy<?php
$str = "@@HelloWorld";
$str1 = substr($str, 1);
echo $str1 . "\n\n";
$str1 = substr($str, 2);
echo $str1;
?>
Posted by: Guest on April-23-2021
0

Remove Special Character in PHP

phpCopy<?php
$str = "ei all, I said eello";
//$trans = array("h" => "-", "hello" => "hi", "hi" => "hello");
echo "Output:  " . strtr($str, "e", "h");
?>
Posted by: Guest on April-23-2021

Browse Popular Code Answers by Language