The data inside the variable (I call $location) is as follows:
Shawnee, KS (66214)
We want to loose the space and (66214)... the code I tried is this:
Code: Select all
$location = preg_replace(' (ї0-9+])','', $location);
$location = trim($location);Shawnee, KS ()
I am not sure being as I am not good at defining regular expressions, can someone tell me what is wrong with my replace command.
earlier someone suggested that I use str_replace but that will break whenever we change the zipcode of the weather XML feed.
Thanks,