function index() { //Create object of Simple_html_dom class $html = new Simple_html_dom(); //use Simple_html_dom class function load_file $html->load_file('http://www.google.com'); //use Simple_html_dom class function find foreach ($html->find('img') as $element) { echo $element->src . '<br>'; } }