I replace all spaces with hyphens in my script like this:
$final = str_replace(' ','-',$final); The - is the only thing I replace.
What I'm replacing are Band Name - Song Name
So in this case, if I had something like:
Metallica - Hero of the Day
I end up with:
Metallica---Hero-of-the-Day
Notice the 3 ---
there?
Can you suggest an elegant way of ending up with just one -
instead of 3.
I can keep doing str_replace until it's done, but that doesn't see right.