Use PHP Simple HTML DOM Parser to find .zip? -



Use PHP Simple HTML DOM Parser to find .zip? -

i'm new php simple html dom parser , i'm trying list links end in .zip , -animal.jpg i'm not sure how it.

i've tried searching on google no avail, below white page.

// create dom url or file $html = file_get_html('<domain removed>'); // find -animal image files foreach($html->find('-animal.jpg') $element) echo $element->href . '<br>'; // find zip files foreach($html->find('.zip') $element) echo $element->href . '<br>';

you utilize strpos() search particular href. example:

$links = $html->find('a'); foreach($links $link) { if( (strpos($link->href, '-animal.jpg') !== false) || (strpos($link->href, '.zip') !== false) ) { echo $link->href . '<br/>'; } }

php html simple-html-dom

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -