$string = "' ! ; • ,\ KarSho: ; • ;}";
Here I want remove following characters,
$remove = array("'","!",";","•",",","\","}","{","[","]");
This is also input. I want from above array characters from $string. Finally I want string like,
KarSho:
$string = "' ! ; • ,\ KarSho: ; • ;}";
Here I want remove following characters,
$remove = array("'","!",";","•",",","\","}","{","[","]");
This is also input. I want from above array characters from $string. Finally I want string like,
KarSho:
Use the following code:
$remove = ["'","!",";","•",",","\\","}","{","[","]"," "];
$replace_with = [];
$string = "' ! ; • ,\ KarSho: ; • ;}";
print str_replace($remove, $replace_with, $string);
You need to add one more \ with \
You can use this code
$string = "' ! ; • ,\ KarSho: ; • ;}";
echo $new_str = str_replace(str_split('\\/!;•,}:*?"<>|'), ' ', $string);