<?php
 
 function sayfayaBaglan( $_URL ){ 
  $useragent = &#039;Mozilla/5.0 (Windows; U; Windows NT 5.1; tr-TR; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13&#039;;
  $referer = &#039;http://www.google.com/&#039;;
  $ch = curl_init();
  $zaman = 0;
  curl_setopt ($ch, CURLOPT_URL, $_URL); 
  curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); 
  curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $zaman); 
  curl_setopt ($ch, CURLOPT_REFERER, $referer); 
  curl_setopt ($ch, CURLOPT_USERAGENT, $useragent); 
  $rmx = curl_exec&#40;$ch&#41;; 
  curl_close($ch); 
  return $rmx; 
 } 

 $siteAdresi = sayfayaBaglan("https://www.google.com.tr/search?q=blog&oq=blog&sourceid=chrome&ie=UTF-8");
 
 preg_match_all(&#039;#<h3 class="r"><a href="(.*?)" q=&#039;) ){
  
   $key = str_replace(&#039; q=&#039;, &#039; sa=&#039;, $key);
   
   $key = mb_substr($keyExp[0], 0, -5);
  
   $siteAdresi2 = sayfayaBaglan($key);
   
   if ( strstr($siteAdresi2, &#039;>&#039;;
    
   }else{
    
    echo $key.&#039; ----> değil<br>&#039;; 
    
   }
   
  }
  
 }
 
?>

Add a code snippet to your website: www.paste.org