You will be able to get information about zipCode by instantiate your searcher.
composer
php 7.0 >=
run
composer require newtz/zipcode
After that just import the class ZipCode
use ZipCode\ZipCode;
ZipCode::getSearcher()
expects a country abbreviation. If none is passed it will search in Brazil.
$searcher= ZipCode::getSearcher('US');
$searcher->find('90210');
echo $searcher->address;
output: Beverly Hills - California. 34.0901, -118.4065.
$searcher->address->street
- available to Brazil searches otherwise is null
$searcher->address->state
- available in all searches
$searcher->address->city
- available in all searches
$searcher->address->neighborhood
- available in Brazil searches otherwise is null
$searcher->address->latitude
- available in WorldWide searches otherwise is null
$searcher->address->longitude
- available in WorldWide searches otherwise is null
To get started...
- 🍴 Fork this repo!
- 👯 Clone this repo to your local machine using
https://github.com/Newtz/ZipCodeSearcher
- 🎋 Create your feature branch using
git checkout -b my-feature
- ✅ Commit your changes using
git commit -m 'feat: My new feature'
;
- 📌 Push to the branch using
git push origin my-feature
;
- 🔃 Create a new pull request
After your Pull Request is merged, can you delete your feature branch.
To run the tests execute the command
./vendor/bin/phpunit --process-isolation
This project is licensed under the MIT License