This is a rewritten version of this class I found somewhen (don't remember when or where), but now for Yii framework.
- Yii 1.1.6 or above
- A DBMS like MySQL, FirebirdSQL, PostgreSQL, OracleDB or any other.
- Decompress the file in application.extensions
- Import the SQL file into your DB
$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);