How can I delete a charcter from string in PHP?
-
06-07-2019 - |
Question
How can I delete a character from string in PHP ?
$s = "waseem";
Are there a function like delChar($s , 2); ? which 2 is the index of the Character , I search but I didn't find anything . any ideas ?
Solution
substr_replace is what you want.
$s = substr_replace($s, '', 2, 1);
OTHER TIPS
$s[2] = '';
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow