dilbertone Posted May 22, 2011 Share Posted May 22, 2011 hello dear community, today i want to apply Curl on a very simple example that gets a HTTP page - review in order to harvest the data of this pretty simple! Well: see this totally easy page: http://www.aktive-buergerschaft.de/buergerstiftungsfinder here we have a list of Foundations: We can see a bunch (approx 1000 records on Foundations). Well - my intention is to store the data in a locally database (favourite db is MySQL): here is my simple approach - what is missing are two parts: The processing of the results and the storing of the results of the parser - into the MySQL-DB. This part goes somewhat over my head. Well the result of the Fetching with Curl should be given to arrays - shouldn ´t it!? If someone can help me here i would be glad! <?php // // A very simple example that gets a HTTP page. // $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, "http://www.aktive-buergerschaft.de/buergerstiftungsfinder"); curl_setopt ($ch, CURLOPT_HEADER, 0); curl_exec ($ch); curl_close ($ch); // well here i want to put the results into an array... [multidimensioal or not !?! ] ?> see the example here on this page: (at the top) Bürgerstiftung Lebensraum Aachen rechtsfähige Stiftung des bürgerlichen Rechts Ansprechpartner: Hubert Schramm Alexanderstr. 69/ 71 52062 Aachen Telefon: 0241 - 4500130 Telefax: 0241 - 4500131 Email: [email protected] www.buergerstiftung-aachen.de >> Weitere Details zu dieser Stiftung The link "Weitere Details zu dieser Stiftung" which is: in english More details to this Foundation" This link has to be followed and the results (also) to be parsed. If you follow the link then you see: There are some additional infos that should be stored too! Well - what is needed now: I need to have the details for the arrays Can any body enlarge the codebits that can be seen above - and give me a hint!? I look forward to this... db1 Quote Link to comment https://forums.phpfreaks.com/topic/237134-apply-curl-on-very-simple-example-that-gets-a-http-page-pass-results-to-array/ Share on other sites More sharing options...
dilbertone Posted May 22, 2011 Author Share Posted May 22, 2011 well - if we enlarge the code to this - i need to have some ideas how to store the data into mysql: $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); print_r($result); Well - what is needed now: I need to have the details for the stuff - in order to store all the results in a MySQL-DB. Can any body enlarge the codebits that can be seen above - and give me a hint!? I look forward to this... Quote Link to comment https://forums.phpfreaks.com/topic/237134-apply-curl-on-very-simple-example-that-gets-a-http-page-pass-results-to-array/#findComment-1218779 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.