<?php
include( 'scrape.class.php' );
$info = new Scrape('http://www.zip-codes.com/search.asp?fld-city=Lansing&fld-state=MI&selectTab=2&Submit=Find+ZIP+Codes');
$rows = $info->split('techHover',0,1);
foreach( $rows as $row ){
$zip = $info->extractText($row, '.asp">');
// some string manipulation to get what you want
$cty = $info->extractText( substr($row, strpos($row, '/county')), '.asp">' );
echo "ZIP Code: {$zip} is in the county of {$cty}<br />\r\n";
}
?>
|