This article mainly introduces how php uses the curl proxy to capture data, and analyzes the operation skills of php using the curl proxy to capture data in the form of instances, for more information about how php uses the curl proxy to capture data, see the next article. This article analyzes php's skills in using curl to capture data by proxy in the form of instances, for more information, see
This example describes how php uses the curl proxy to capture data. We will share this with you for your reference. The details are as follows:
0)/* how long each connect interval */usleep ($ wait_usec); // 250000 = 0.25 sec} while ($ mrc = CURLM_CALL_MULTI_PERFORM ); while ($ running & $ mrc = CURLM_ OK) {if (curl_multi_select ($ mh )! =-1) {do {$ mrc = curl_multi_exec ($ mh, $ running);} while ($ mrc = CURLM_CALL_MULTI_PERFORM );}} /* read data */foreach ($ handle as $ I => $ ch) {$ content = curl_multi_getcontent ($ ch ); $ data [$ I] = (curl_errno ($ ch) = 0 )? $ Content: false;}/* Remove handle */foreach ($ handle as $ ch) {curl_multi_remove_handle ($ mh, $ ch);} curl_multi_close ($ mh ); return $ data ;}$ urls = array ('http: // map.baidu.com '); $ re = async_get_url ($ urls); echo $ re [0];?>