PHP simple_html_dom foreach

I’m getting html from different pages ($linkHtml) and want to get elements from those pages. With this I get Fatal error: Call to a member function find() on a non-object. If I move the second foreach out I get the result that I want from one page. How should I do to get the elements from all pages?

$url = 'http://page/';

foreach ($dataArray as $link) {
        $linkHtml = file_get_html($url . $link);

        foreach ($linkHtml->find('text') as $text) {

        }
}

Leave a Reply

*

Hire Me
Follow Me!
Search
Most Popular Articles & Pages
Because your vote is Important
Sorry, there are no polls available at the moment.
Categories