Hi,
If I understand you correctly, then the following command will help you:
str_replace(" ", "", $string);
[That is, replace the string's spaces with nothing. This might mean doing a search twice, but also see below.]
I'm not sure what your needs are here, but you might alternatively use:
str_replace(" ", "%", $string);
So a search term:
LIKE "%Melbourne Victoria%"
[finds only Melbourne Victoria]
Becomes:
LIKE "%Melbourne%Victoria%"
[finds Meblourne Victoria, MelbourneVictoria, Melbourne is in Victoia]
Cheers,
Duncan.