Html,curl and file_get_contents are not caught, but the page can be opened directly

Source: Internet
Author: User
Html,curl and file_get_contents are not captured, but the page can be opened directly.
Html,curl and file_get_contents are not captured, but the page can be opened directly.

Ask

The URL is as follows
https:/count.taobao.com/counter3?keys=sm_368_dsr-1097280647,iccp_1_522177046867&callback=jsonp107

Why can't I catch the content, it's always empty
------to solve the idea----------------------

$ch = Curl_init ();
$url = ' https://count.taobao.com/counter3?keys=SM_368_dsr-1097280647,ICCP_1_522177046867&callback=jsonp107 ';
curl_setopt ($ch, Curlopt_url, $url);
curl_setopt ($ch, Curlopt_returntransfer, 1);
curl_setopt ($ch, Curlopt_ssl_verifypeer, 0);
curl_setopt ($ch, curlopt_ssl_verifyhost,0);
curl_setopt ($ch, Curlopt_header, 0);
$output = curl_exec ($ch);
Curl_close ($ch);
echo $output;

------to solve the idea----------------------
Take it and play it.
 
  $jsonp =file_get_contents (' https://count.taobao.com/counter3?keys=SM_368_dsr-1097280647,ICCP_1_522177046867 &callback=jsonp107 ');

$jsonp = ' jsonp107 ({"sm_368_dsr-1097280647": {v:0,nv:100,m_ufb:0,m:4.89661,m_g:20.15,s_ufb:0,s:4.8744,s_g:31.49,c _ufb:0,c:4.87867,c_g:39.55,gp:100.00,ss:290159,hdr:true}, "iccp_1_522177046867": 4915});

Preg_match_all ('/\d{1,}}/', $jsonp, $arr);
echo Trim ($arr [0][0], '} ');
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.