Turn Over Address Components to an Array


/ Published in: PHP
Save to your folder(s)

Breaks up an address (in this case returned by Advanced Custom Fields Location plugin) into it's components. Additionally, sorts a multidimensional array of locations alphabetically by state. This works for basic addresses assuming that address is in the format 'street, city, state, zip, country.' I've written a more extensive version of this snippit that uses Google Geocoding to get the address components and store them in a Wordpress database as meta data.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.