I have a Problem with RegEx and PHP, I have this string:
Panorama - SPIEGEL ONLINE - Nachrichten Schlagzeilen Hilfe RSS Newsletter Mobil Wetter TV-Programm Dienstag, 26. Februar 2013 Panorama NACHRICHTEN Home Politik Deutschland Ausland WirtschaftB
I would like to strip all spaces, which are not needed, so all spaces but one, so that the words are still seperated by one space.
I wrote this regex:
echo trim(preg_replace("/\s+/", " ", $lol));
And I'm very close:
Panorama - SPIEGEL ONLINE - Nachrichten Schlagzeilen Hilfe RSS Newsletter Mobil Wetter TV-Programm Dienstag, 26. Februar 2013 Panorama NACHRICHTEN Home Politik Deutschland Ausland WirtschaftB
What am I missing? Thank you very much!