This is a rewritten version of this class I found somewhen (don't remember when or where), but now for Yii framework.
Requirements ¶
- Yii 1.1.6 or above
- A DBMS like MySQL, FirebirdSQL, PostgreSQL, OracleDB or any other.
Usage ¶
- Decompress the file in application.extensions
- Import the SQL file into your DB
- Enjoy
$zip = new ZipLocator();
/**
* Calculate the distance between two zip codes
*/
echo $zip->distance('00210', '00610');
/**
* Load the Zip codes with 10 miles radius
*/
$zips = $zip->inradius('00210', 10);
var_export($zips);
User Contributed Notes 2
Name?
Is this extension US-only? Why don't you mark it in page title/extension name?
You're right
Currently, it only works for US zip codes, however, it is planned an implementation for international zip codes.
Leave a comment
If you have any questions, please ask in the forum instead.
Join the conversation to share a note.