Forum Moderators: coopster
How would I go about checking if a string contains more than one consecutive space in it?
What I mean by consecutive is to check if there is, anywhere in the string more than one space after another. A single space is okay but anything more than one in a row is what I want to check for.
Thanks in advance!
Even if you're trying to replace the spaces, regular expressions generally take longer to execute, so there's no reason not to just use str_replace(' ', '', $string); # Note 2 spaces here, forum won't show them both.