• 对接万里牛erp 的curl方法和毫秒级时间戳


    对接万里牛erp 的curl方法

    public function curlpost($url,$data){         

      $headerArray = array("Content-type: application/x-www-form-urlencoded;charset=UTF-8","Accept: application/json","Cache-Control: no-cache", "Pragma: no-cache");         

      $curl = curl_init();         

      curl_setopt($curl, CURLOPT_URL, $url);         

      curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);         

      curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,FALSE);         

      curl_setopt($curl, CURLOPT_POST, 1);         

      curl_setopt($curl, CURLOPT_POSTFIELDS, $data);       

      curl_setopt($curl,CURLOPT_HTTPHEADER,$headerArray);         

      curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);         

      // echo '<pre/>';print_r($curl);         

      $output = curl_exec($curl);                 

      echo '<pre/>';print_r($output);die;         

      curl_close($curl);                 

      return json_decode($output,true);         

    }         

    //获取毫秒级时间戳     

    public function getMsecTime()     {         

      list($msec, $sec) = explode(' ', microtime());         

      $msectime =  (float)sprintf('%.0f', (floatval($msec) + floatval($sec)) * 1000);         

      return $msectime;             

    }

  • 相关阅读:
    [CEOI2008] order
    Atcoder 2373 Cookie Exchanges
    [POI2011]ROT-Tree Rotations
    bzoj 5216: [Lydsy2017省队十连测]公路建设
    bzoj 5215: [Lydsy2017省队十连测]商店购物
    Codeforces 961 E Tufurama
    [九省联考2018] 秘密袭击coat
    Codeforces 961 D Pair Of Lines
    [八省联考2018] 劈配
    [九省联考2018]一双木棋chess
  • 原文地址:https://www.cnblogs.com/DevilBoy/p/13032555.html
Copyright © 2020-2023  润新知