• 08-01-2018, 17:16:07
    #1
    Merhabalar normalde api kullanırken kolayca alabiliyorum istediğimi fakat değiştirip html olarak yaptılar yani <strong>xxx</strong> olarak ben bu strong içindekileri nasıl alabilirim .
  • 08-01-2018, 17:27:38
    #2
    Kimlik doğrulama veya yönetimden onay bekliyor.
    $veri = '<strong>xxx</strong>';
    echo strip_tags($veri);
  • 08-01-2018, 17:33:53
    #4
    //konu çekmek için curl ayarlanıyor
    function curl_cek($url){
    $useragent = 'Mozilla/5.0 (compatible; Googlebot/2.1; +[URL]http://www.google.com/bot.html)';[/URL]
    $referer = 'https://www.google.com.tr';
    $ch = curl_init();
    curl_setopt ($ch, CURLOPT_URL, $url);
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt ($ch, CURLOPT_COOKIEFILE,dirname(__FILE__).'/cookie.txt');
    curl_setopt ($ch, CURLOPT_REFERER, $referer);
    curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt ($ch, CURLOPT_HEADER, 0);
    curl_setopt ($ch, CURLOPT_USERAGENT, $useragent);
    //curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, false);
    $rmx = curl_exec($ch);
    curl_close($ch);
    return $rmx;
    }
    //içerikleri ayıklamak için fonksiyon yazılıyor
    function ara($bas, $son, $yazi)
    {
    @preg_match_all('/' . preg_quote($bas, '/') .
    '(.*?)'. preg_quote($son, '/').'/i', $yazi, $m);
    return @$m[1];
    }
    $cek = curl_cek("cekileceksite.com");
    
    $icerik= ara('<title>','</title>',$cek);
    print_r($icerik);
  • 08-01-2018, 18:06:55
    #5
    İstediğim şey <strong>buradakiyazi</strong> adamlar eskiden api ile json_decode yaparak çekebiliyordum fakat adamlar html yaptı çekemiyorum.

  • 08-01-2018, 21:47:15
    #6
    preg_match_all('@<strong>(.*?)</strong>@si',$cekilenveri,$olusanveri); foreach($olusanveri[1] as $veri){ echo $veri; }
    bu metodla çektiğin sayfadaki tüm strong içeriği alablirsin