I want to remove one white space if found two white space between phrase in php, I can detect if there is two white space or not, but I can not remove white space, here is how I tried,
my_doublespace = "Marketing and Sales Staff";
if(strpos($my_doublespace, ' ') > 0){
dd('including double space');
}
else{
dd('no double');
}
I want the result like this "Marketing and Sales Staff", only one white space between "Marketing" and "and". Is there anyway to remove it?