I need to match the following using preg_match()
cats and dogs
catsAndDogs
i like cats and dogs
etc, so i simply stripped out the spaces and lowercased it and used that as my pattern in preg_match();
'/catsanddogs/i'
But now I need to match the following too:
cats+and+dogs
cats_and_dogs
cats+and_Dogs
So is there quick and easy way to do a string replace multiple times, other than nesting it? I want to end up with the same pattern to match with.
Thanks.