preg_match_all('/(?P<state>[AZ]{2,3})\s\d{4}$/m', $str, $matches); var_dump($matches['state']);
Output
array(3) { [0]=> string(3) "VIC" [1]=> string(3) "VIC" [2]=> string(3) "VIC" }
This uses regex in multi-line mode according to two or three uppercase letters preceding the space character and 4-digit postal code.
I called it state because I live in Australia, and that's all Australian states :)
source share