I’m trying to extract two pieces of information from a location.
An example location would be:
Hocking Parade, Sorrento WA 6020
Where I’m trying to extract “Sorrento” and “6020”.
“Hocking Parade” is a street that I don’t need, which will always be followed by a comma. “WA” is a constant. The post code is 4 digits.
EDIT: Should clarify the date is actually in the format:
<span>Hocking Parade, Sorrento WA 6020</span>
Works:
preg_match('/^.*, (.*) [A-Z]{2} (\d{4})$/','Hocking Parade, Sorrento WA 6020',$uTitle);
Doesn’t work:
preg_match('/^.*, (.*) [A-Z]{2} (\d{4})$/','<span>Hocking Parade, Sorrento WA 6020</span>',$uTitle);
This is what you need:
cheers,