Can anyone help me with a quick regex problem?
I have the following HTML:
555 Some Street Name<BR />
New Providence VA 22901-1311<BR />
United States<BR />
The first row is always the Street
Second row is City (which can have spaces) space State Abbv. space Zip hyphen 4 digit zip
Third row is the Country.
I need to break the HTML into a variable each. Can anyone provide a quick regex?
Edit: Maybe I wasn’t clear. I need the following:
Street address, City, State, Zip, 4Digit Zip, Country as individual variables.
ok, for the first part, let’s split the lines
now you need to get the informations from the second line to be parsed as well…
$tmp = explode(‘ ‘, $array[1]);
and all you need now is to set everything in the correct variable names