liridian / pincode-directory
PHP wrapper for All India Pincode Directory
1.0.0
2017-05-14 03:34 UTC
Requires
- php: >=5.6
- guzzlehttp/guzzle: 5.*
Requires (Dev)
- phpunit/phpunit: ~4.0||~5.0||~6.0
- squizlabs/php_codesniffer: ^2.3
This package is not auto-updated.
Last update: 2024-05-12 00:44:35 UTC
README
A PHP wrapper for the All India Pincode directory API provided by the Ministry of Electronics & Information Technology,Government of India
Build Status
Usage
Here's an example of using the PHP wrapper -
<?php require_once "vendor/autoload.php"; use Liridian\PincodeDirectory; $client = new Liridian\PincodeDirectory(); $available_filters = $client->getAvailableFilters(); $available_fields = $client->getAvailableSelectFields(); $locale = $client ->withApiKey($api_key) ->withFilter([['pincode' => '400089']]) ->withSort([['pincode' => 'asc'], ['officename' => 'desc']]) ->get(); echo '<h1>PincodeDirectory Test</h1>'; echo 'Available filters:'; echo '<pre>'.json_encode($available_filters, JSON_PRETTY_PRINT).'</pre>'; echo 'Available fields:'; echo '<pre>'.json_encode($available_fields, JSON_PRETTY_PRINT).'</pre>'; echo 'Sample response:'; echo '<pre>'.json_encode($locale, JSON_PRETTY_PRINT).'</pre>';