function startBot($site_url,$timeout = 5)
{
$ch = curl_init();
$tarayici = 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30';
curl_setopt($ch, CURLOPT_URL,$site_url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER , 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER , 1);
curl_setopt($ch, CURLOPT_HEADER , 0);
curl_setopt($ch, CURLOPT_TIMEOUT ,$timeout);
curl_setopt($ch, CURLOPT_USERAGENT , $tarayici);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
$kaynak = startBot('https://www.yelp.com/search?find_desc=Restaurants&start=0&l=p:NY:New_York:Manhattan:Alphabet_City',30);
preg_match_all('@(.*?) @si' , $kaynak , $title_cikti);
echo "";
print_r($title_cikti);
echo "
";
/* preg_match_all('@(.*?)<\/span>@si' , $kaynak , $desc_cikti);
echo "";
print_r($desc_cikti);
echo "
";*/
/*bu resimleri çekiyor
preg_match_all('
@(.*?)@si' , $kaynak , $desc_cikti2);
echo "";
print_r($desc_cikti2);
echo "
";
*/
preg_match_all('
@@si' , $kaynak , $desc_cikti2);
echo "";
print_r($desc_cikti2);
echo "
";
?>