PHP function to parse street address data

We require a robust PHP function to parse a given street address into its different elements being [apartment number][street number][street][suburb][state][postcode]. The given street address data may be given in different various forms, the function will need to break down the address into its proper form, or return an "invalid" address.

For example, raw data to be something like this:

- Raw data: "22/8 Victoria St, Manly NSW 2008", to return [22] [8] [Victoria Street] [Manly] [NSW] [2008]

- Raw data: "Unit 22, 8 Victoria street, Manly NSW 2008", to return [22] [8] [Victoria Street] [Manly] [NSW] [2008]

- and all various cases (pls see attachment)


- Function needs to be heavily commented, well structured and easily followable (this is part of a larger project)

- Needs to take into account many different street address formats (please see attachment)

- Street type needs conversion if abbreviated i.e. st = Street, Rd = Road, ave = Avenue (please see attachment for all cases)

- The parsed street address should be returned as an array $address['apt_num'], $address['st_num'], $address['street'] etc

- Function should only return the above address array if passes all the filters and can be correctly parsed, some addresses may be invalid

- If "apartment number" AND/OR "state" AND/OR "postcode" are not provided for, that is acceptable. All other elements are required

Other comments:

- Use of preg is fine

- Use of google maps to verify is fine

- State is always 3 alpha characters in caps

- Postcode is always 4 numeric characters long

Note: This is not a scrapping exercise! The street address will be given per the excel file attached. The function is expected to return the desired results in the excel file for a given string.

Compétences : PHP

en voir plus : php parse street address, php function parse address, php verify, php function for, number function, in victoria, function number, address is invalid, address invalid, php parse street address google example, php address street data, victoria, street 3, php function , parsed, parse, parse and, function, data structured, ave, array form, form array, parse array php, suburb postcode, break requirements

Concernant l'employeur :
( 10 commentaires ) Hong Kong, Hong Kong

Nº du projet : #1630708

Décerné à:


Hi. My bid is low because the task is relatively easy and, besides, this would be my first project at Freelancer.com. I'm looking forward to this job. Thank you.

%selectedBids___i_sum_sub_4% %project_currencyDetails_sign_sub_5% USD en 1 jour
(3 Commentaires)

11 freelance font une offre moyenne de $95 pour ce travail


ready to deliver

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 5 jours
(80 Commentaires)

I can do this parsing according to your needs.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 3 jours
(53 Commentaires)

**** Hi sir, I am ready to start working on your project right away. I'm an experienced Web Developer having worked for 4+ years with PHP, Java, Solr/Lucene, Sphinx Search, Smarty, MySQL, SQL Server, ASP, JavaScript, A Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 2 jours
(55 Commentaires)

I specialize in similar projects. Please check PM for more details.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 2 jours
(19 Commentaires)

Ready to start this project.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 3 jours
(57 Commentaires)

Hi, I have experience in data parsing and will be able to parse your data in php for you. I can show you a sameple if you have some time. Thank you.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 3 jours
(9 Commentaires)

Please check PMB for details.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 2 jours
(2 Commentaires)

Why offshore? I can write this function and provide well detailed documentation. As well as host this function on my cloud server so we can test all use cases. [url removed, login to view]

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 2 jours
(0 Commentaires)

Hi. iam start immediately i will give you 100% quality work very fast iam Web designer Expert in 5 + creating front page and landing page,Logo, banner, email-newsletters, poster, designing with graphically and prof Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 5 jours
(1 Évaluation)

I will complete SEO in 4 days..

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 4 jours
(0 Commentaires)

<b><i>Removed by Admin</i></b> - Custom software development - skpye: <b><i>Removed by Admin</i></b>

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(0 Commentaires)