PHP Classes

File: ziptest.php

Recommend this page to a friend!
  Classes of Dr Tarique Sani   php Zip Locator   ziptest.php   Download  
File: ziptest.php
Role: Example script
Content type: text/plain
Description: A file to test the class
Class: php Zip Locator
Locate near zip codes and distance between them
Author: By
Last change:
Date: 22 years ago
Size: 444 bytes
 

Contents

Class file image Download
<?php
include_once ("db_mysql.inc");
include_once (
"phpZipLocator.php");

$db = new db_sql;

$zipLoc = new zipLocator;

$zipOne = 12345;
$zipTwo = 23456;

$distance = $zipLoc->distance($zipOne,$zipTwo);

echo
"The distance between $zipOne and $zipTwo is $distance Miles<br>";

$radius = 20;
$zipArray = $zipLoc->inradius($zipOne,$radius);

echo
"There are ",count($zipArray)." Zip codes within $radius Miles of $zipOne";

?>