2017 © Pedro Peláez
 

library php-ziptastic

A simple class for accessing the Ziptastic API (https://www.getziptastic.com/)

image

grmule/php-ziptastic

A simple class for accessing the Ziptastic API (https://www.getziptastic.com/)

  • Tuesday, May 5, 2015
  • by GRMule
  • Repository
  • 1 Watchers
  • 1 Stars
  • 31 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

PHP-Ziptastic

A simple PHP class used to access the Ziptastic API., (*1)

Sample usage:, (*2)

$zt = new PHPZiptastic\Ziptastic(49504);

print $zt->city; // Grand Rapids

print $zt->lookup(34231)->city; // Sarasota

print $zt->lookup(44870); // Bloomingville, OH

print json_encode($zt); // {"city":"Bloomingville","state":"OH","zip":"44870"}

Errors and Exceptions

By default, errors (zip not found, malformed zip passed) will place a message in the $error property, and return a self-reference. This looks like:, (*3)

print $zt->lookup(12344)->city; // null
print $zt->error; // Invalid zip code

If you would like to catch an exception instead, pass TRUE as a second constructor parameter:, (*4)

$zt = new Ziptastic(null, true);
$zt->lookup(12344); // exception thrown here

OR, (*5)

$zt = new Ziptastic(12344, true); // exception thrown here

For all errors, the exception throw is the base PHP Exception class., (*6)

Installation

Include Ziptastic.php or install the composer package., (*7)

Ziptastic

Ziptastic is a simple API that allows people to ask which Country,State and City are associated with a Zip Code., (*8)

More info at http://daspecster.github.com/ziptastic/, (*9)

Many thanks to ElevenBaseTwo (http://blog.elevenbasetwo.com/) for shortening our forms!, (*10)

The Versions

05/05 2015

dev-master

9999999-dev https://github.com/GRMule/PHP-Ziptastic

A simple class for accessing the Ziptastic API (https://www.getziptastic.com/)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

zip postal ziptastic

05/05 2015

1.0.0

1.0.0.0 https://github.com/GRMule/PHP-Ziptastic

A simple class for accessing the Ziptastic API (https://www.getziptastic.com/)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

zip postal ziptastic