did you check if str_replace will do better here?