Search code examples
phpparsingwebsimple-html-dom

Please How to Parse a Web Site with PHP


I do a simple project in my department. I want to call the movie at the movie site, but I don't know how to write a regular expression. I've tried everything in a variety of ways, but I can't. I don't know how to fill out the code. Let me know. I am not using jquery, but I am only using simple html dom, snooping.

enter image description here


Solution

  • If what you want is to have a list of all times, put them in a n array with something like this(you do not need regex for this if you are usin php dom parser):

    $timesArray = [];
    foreach($html->find('div[class=info-timetable] li a em') as $times) {
            $timesArray[] = $times->plaintext;
    };
    

    PS: Never post images with your code, instead paste the code in your question mate!