dilenci adlı üyeden alıntı: mesajı görüntüle
bir örnekle paylaşabilir misiniz hocam. mesela şu 2 sayfaya bağlanıp titlerini alsın

https://www.r10.net/djital-urunler-a...n-gidiyor.html

https://www.r10.net/bozdurma-exchang...z-yapilir.html

Curl.php

  function multi_thread_curl($url_array, $number_threads) {


$curl_array = array_chunk($url_array, $number_threads, $preserve_keys = true);

     foreach($curl_array as $threads) {

         foreach($threads as $key=>$value) {

        ${'ch' . $key} = curl_init();

        curl_setopt(${'ch' . $key}, CURLOPT_URL, $value);
        curl_setopt(${'ch' . $key}, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt(${'ch' . $key}, CURLOPT_RETURNTRANSFER, true);
        curl_setopt(${'ch' . $key}, CURLOPT_TIMEOUT, 10);

        }


         $mh = curl_multi_init();

         foreach($threads as $key=>$value) {

        curl_multi_add_handle($mh, ${'ch' . $key});

        }

        $active = null;

         do {

        $mrc = curl_multi_exec($mh, $active);

        } while ($mrc == CURLM_CALL_MULTI_PERFORM);

        while ($active && $mrc == CURLM_OK) {

            if (curl_multi_select($mh) != -1) {
                do {

                    $mrc = curl_multi_exec($mh, $active);

                } while ($mrc == CURLM_CALL_MULTI_PERFORM);
            }

        }

         foreach($threads as $key=>$value) {

        $results[$key] = curl_multi_getcontent(${'ch' . $key});

        curl_multi_remove_handle($mh, ${'ch' . $key});

        }

         curl_multi_close($mh);

 
    }


    return $results;



}
include 'curl.php';


$urls = array(

  'https://www.r10.net/bozdurma-exchange-islemleri/3364232-paypal-bozum-isleriniz-yapilir.html'
  'https://www.r10.net/djital-urunler-acik-arttirma/3364233-128142-sizlere-google-dan-para-kazandiracak-checklist-1tl-den-gidiyor.html'

);

$birincisayfa= multi_thread_curl($urls, 1);
$ikincisayfa  = multi_thread_curl($urls, 2;