PHP matching a string
- by John Jones
Hi,
I have an Indian company data set and need to extract the City and Zip from the address field:
Address Field Example:
Gowripuram West, Sengunthapuram Post, Near L.G.B., Karur, Tamilnadu, Karur - 639 002, India
As you can see the City is Karur and the zip is followed after the - (hyphen).
I need the PHP code to match [city] - [zip]
Not sure how to do this I can find the Zip after the Hypen but not sure how to find the City, please note the City can be 2 words.
Cheers for your time./
J