while i want to parse this database with 3000 records in it;:
http://www.edi.admin.ch/esv/00475/00698 ... ml?lang=de
with this code:
Code: Select all
<?PHP
// Original PHP code by Chirp Internet: http://www.chirp.com.au
// Please acknowledge use of this code by including this header.
$url = "http://www.edi.admin.ch/esv/00475/00698/index.html?lang=de";
//$input = @file_get_contents($url) or die("Could not access file: $url");
$input = file_get_contents($url) or die("Could not access file: $url");
$regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>";
if(preg_match_all("/$regexp/siU", $input, $matches, PREG_SET_ORDER)) { foreach($matches as $match) {
// $match[2] = all the data i want to collect...
// $match[3] = text that i need to collect - see a detail-page
print_r($matches);
}
}
?>
note - i want to get all the data out of this database: http://www.edi.admin.ch/esv/00475/00698 ... ml?lang=de
At the moment we have these results:
how to proceed: ?!
.....and so forth and so forth!! ...[16] => Array
(
* => <a href="/esv/index/index.html?lang=de" title="Zum Schlagwort-Index" class="webServiceContent" accesskey="6">Index</a>
[1] => "
[2] => /esv/index/index.html?lang=de
[3] => Index
)
[17] => Array
(
* => <a href="/esv/printtool/index.html?lang=de" title="Printtool" class="webServiceContent">Printtool</a>
[1] => "
[2] => /esv/printtool/index.html?lang=de
[3] => Printtool
)
[18] => Array
(
* => <a href="/hinweise/index.html?lang=de" title="Zu den Bedienungshinweisen" class="webServiceContent">Hilfe</a>
[1] => "
[2] => /hinweise/index.html?lang=de
[3] => Hilfe
)
[19] => Array
(
* => <a href="/esv/00475/00698/index.html?lang=de" class="webSpracheAktiv" title="Diese Seite auf deutsch">Deutsch</a>
[1] => "
[2] => /esv/00475/00698/index.html?lang=de
[3] => Deutsch
)
[20] => Array
(
* => <a href="/esv/00475/00698/index.html?lang=fr" class="webSpracheInaktiv" title="Cette page en fran�ais">Fran�ais</a>
[1] => "
[2] => /esv/00475/00698/index.html?lang=fr
[3] => Fran�ais
)