/lib/action/PublicAction.class.php

class PublicAction extends Action{
//curl,返回数组
    public function get_curl_json($url){
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
        $result = curl_exec($ch);
        if(curl_errno($ch)){
            print_r(curl_error($ch));
        }
        curl_close($ch);
        return json_decode($result,TRUE);
    }
}

/lib/action/GameAction.class.php

$usage="http://api.xxx.com/xxx/pay.php?username=".$username."&p>;
        $Public = A("Public");
        $data = $Public->get_curl_json($usage);
        $retCode = $data["orderid"];

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2022-02-27
  • 2021-12-02
  • 2022-01-03
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-04
  • 2022-12-23
  • 2021-11-28
相关资源
相似解决方案