i want to parse a site http://www.aktive-buergerschaft.de/buergerstiftungsfinder
Well therefore i have a true beginner-question regarding Array in order to work with the data: beginner question
The results should be stored in a MySQL-Database: well you see. i have a Curl-Approach: and i want to work with the parsed data: and in this case i want to give over the data into an array (if viewing the output in web browser, do view-source to see structured array).
Here the musings that led to the code:
Depending on num dimensions, we could do, foreach($result as $k => $v) {echo $k." ".$v}
to view and work with data (adding sub foreach loops accordingly; i.e. if $v is itself an array)
see the results: What do you think:
$ch = curl_init("http://www.aktive-buergerschaft.de/buergerstiftungsfinder");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$buffer = curl_exec($ch);
curl_close($ch);
$result = explode(",", $buffer);
foreach($result as $k => $v) {echo $k." ".$v}
if $v is itself an array)
// print_r($result);
look forward to hear from you!!
bernard the biker