I finally have a question that isn't already answered on Stack Overflow for PHP.
I need to save the city, state, zip in different variables. Given the string
$new = "PALM DESERT SD63376 "
I am trying to strip spaces that are grouped in 2 or more so I can keep a city 2 words when it is supposed to be. Beyond that I can figure out but all my searching either shows how to split a string in a different language (Java), or how to split at one space which I cannot do.
I'm trying to use
$addr = preg_split('#^.*(?=\s{2, })#', $new);
but I am not getting the string split between PALM DESERT
AND "SD63376 ". Please help!