I need to remove the third character of a string. Here’s what I tried.
$my_string['2'] = "";
This worked find, but when I tried to put this variable in a MySQL query, it returned errors.
What is the best way to remove a certain character (character 3 in my case) from a string?
Try out substr_replace.
For example: