zoukankan      html  css  js  c++  java
  • Thinkphp中controller控制器根据curl函数请求数据

    public function member(){
            $url="http://aitequn.tjnit.com/UserAction_findAllUser";
            $ch =curl_init();
            curl_setopt($ch, CURLOPT_URL, $url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
            curl_setopt($ch, CURLOPT_TIMEOUT, 30);
            $result =curl_exec($ch);
            curl_close($ch);
            $data=json_decode($result,true);
    //        $count=count($data);
    //        echo $count;           
    //        die;
            $this->assign('data',$data);
    
            $this->display();
  • 相关阅读:
    yii分页
    ajax分页
    批删,全选
    网站开发的愿景
    margin collapse 坍塌
    URI URL URN
    Servlet
    Http请求
    进程间通信
    网络编程
  • 原文地址:https://www.cnblogs.com/kangshuai/p/5938436.html
Copyright © 2011-2022 走看看