Skip to content

Instantly share code, notes, and snippets.



Created Nov 18, 2012
What would you like to do?
$url = "";
$total = 128;
$postal = Array();
for ($i=0; $i<=$total; $i++) {
$data = file_get_contents($url.($i*2)."1");
preg_match_all('/<tr onmouseover="ew_MouseOver\(event, this\);" onmouseout="ew_MouseOut\(event, this\);" onclick="ew_Click\(event, this\);">(.*?)<\/tr>/s', $data, $areas, PREG_SET_ORDER);
foreach ($areas as $area) {
preg_match_all('/<div>(.*?)<\/div>/s', $area[1], $aData, PREG_SET_ORDER);
$aNombre = mb_convert_case($aData[0][1], MB_CASE_TITLE, "UTF-8");
$aNombre = substr($aNombre, 0, strrpos($aNombre, ','));
echo '"'.$aNombre.'",';
echo '"'.mb_convert_case($aData[1][1], MB_CASE_TITLE, "UTF-8").'",';
echo $aData[2][1]."\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.