Skip to content

Instantly share code, notes, and snippets.

@JaviPedrera
Created November 16, 2015 18:48
Show Gist options
  • Save JaviPedrera/a55bddc42843f46535bc to your computer and use it in GitHub Desktop.
Save JaviPedrera/a55bddc42843f46535bc to your computer and use it in GitHub Desktop.
<?php
$html = file_get_contents('https://es.search.yahoo.com/search?p=madrid&fr=yfp-t-777');
preg_match('/\<ol class\=\" reg searchCenterMiddle\">(.*?)\<\/ol\>/i', $html, $list);
preg_match_all('/\<li(.*?)\<\/li\>/i', $list[1], $results);
foreach ($results[0] as $result) {
echo strip_tags($result);
echo "<br/>";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment