Good day. I want on my site to implement the menu item on flights of aircraft, but for this I decided to parse the information from another site, http://avia-sng.ru/domodedovo-online.php .

How can I quickly parse this table and install it? All I know is that you need to use preg_match and place a div code in it that needs to be matched. I understand correctly? If possible, show this with the simplest code. Thank.

Closed due to the fact that the issue is too general for the participants user31688, Ipatiev , Ella Svetlaya , alexis031182 , Vladyslav Matviienko Jun 3 '15 at 19:27 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

    3 answers 3

    All I know is that you need to use preg_match and place a div code in it that needs to be matched.

    The one who has invested this "knowledge" in you should be given forehead :) Parsing your pages should be HTML parsers, of which there are several for PHP. Choose any, try, there will be difficulties - please contact. Before that, your question is about nothing.

      With such a question - to freelancers.
      Parser write is a separate and not the easiest order.

      But the algorithm is simple:
      You load the page -> You process it with any HTML parser -> You select the necessary information in its tree -> You save / issue the information in a convenient form.

        try phpquery , it's very simple.

        a little more

        Download this phpQuery library here and connect, make sure that you have curl connected, then:

         include('phpQuery.php'); $ch = curl_init('http:/site.ru/'); //необходимая ссылка curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $results_page = curl_exec($ch); curl_close($ch) $results = phpQuery::newDocument($results_page); //получаем результат if(!empty($results)){ //Если ответ есть //далее просто указываем нежный элемент следующим образом $address = strip_tags($results->find('address')); //по тегу $phone = strip_tags($results->find('.poct-cont-phone')); //по классу $comment = strip_tags($results->find('#comment')); //по id } 
        • Reference links are not welcome here. - user31688 6:49 pm
        • @TheDoctor and what did you leave here a link? - bemulima
        • @bemulima, you do not understand the difference between the links in the answers and the answers, links? On the metee explain, here to engage in educational program is not worth it. - user6550
        • Links are allowed and welcome, but the answer needs a little more than a link. And then I would have half the questions just threw a link in Google with the necessary request. - user31688 7:07 pm
        • I just gave the person a link so that he would read and understand how to solve his problem. Until then, how many have seen such answers, and even thanked. And here on you) Today is not my day, everyone rushes at me) Now I will add an example - bemulima