• php 中使用cURL发送get/post请求,上传图片,批处理


    https://mp.weixin.qq.com/s/8luqMEd8xt8oJxFLLCU1XA

    文章正文

    cURL是利用url语法规定传输文件和数据的工具。php中有curl拓展,一般用来实现网络抓取,模拟发送get   post请求,文件上传。

      在php中建立curl的基本步骤如下:

      1 初始化        2 设置选项,包括url        3  执行并获取结果     4 释放curl句柄。

      在工作和学习中,我也是时常用的curl。由于在使用curl设置选项时,各种选项比较难以记忆,需要参考,故在此记录下常用的一些例子,以便后来参考。

    实例一 : 抓取网页数据(以拉手网开放api为例,也是get请求)

    <?php
    header("Content-type: text/html; charset=utf-8"); 
    $ch = curl_init();//初始化
    
    /*============开始设置curl各种选项================*/
    curl_setopt($ch, CURLOPT_URL, "http://open.lashou.com/opendeals/lashou/city.xml");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    
    
    $html = curl_exec($ch);//执行句柄,获取返回内容
    
    curl_close($ch);//释放句柄
    
    echo $html
    ?>

    如果用这种方法发get请求,参数附加到url后面即可

         如curl_setopt($ch, CURLOPT_URL, "http://localhost/tqj/date/p822.php?name=yyyyy");

    实例 2  利用curl发送post请求

    <?php
    $uri = "http://localhost/tqj/date/p822.php";
    
    // post参数数组
    $data = array (
            'name' => 'tianquanjun',
            'password' => 'tianquanjun',
    );
    
    //初始化
    $ch = curl_init ();
    
    //各种项设置,网上参考而来,可以查看php手册,自己设置
    curl_setopt ( $ch, CURLOPT_URL, $uri );
    curl_setopt ( $ch, CURLOPT_POST, 1 );//post方式
    curl_setopt ( $ch, CURLOPT_HEADER, 0 );
    curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
    curl_setopt ( $ch, CURLOPT_POSTFIELDS, $data );
    
    //执行
    $return = curl_exec ( $ch );
    //释放
    curl_close ( $ch );
    
    print_r($return);
    ?>

    实例三  :curl 过程调试与错误信息处理

    <?php
    $uri = "http://localhost/tqj/date/p822.php";
    
    // post参数数组
    $data = array (
            'name' => 'tianquanjun',
            'password' => 'tianquanjun',
    );
    
    //初始化
    $ch = curl_init ();
    
    //各种项设置,网上参考而来,可以查看php手册,自己设置
    curl_setopt ( $ch, CURLOPT_URL, $uri );
    curl_setopt ( $ch, CURLOPT_POST, 1 );//post方式
    curl_setopt ( $ch, CURLOPT_HEADER, 0 );
    curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
    curl_setopt ( $ch, CURLOPT_POSTFIELDS, $data );
    
    //执行
    $return = curl_exec ( $ch );
    
    //容错机制
    if($return === false){
        var_dump(curl_error($ch));
        }
    
    //curl_getinfo()获取各种运行中信息,便于调试 
    $info = curl_getinfo($ch);
    
    echo "执行时间".$info['total_time'].PHP_EOL;
    
    //释放
    curl_close ( $ch );
    
    print_r($return);
    ?>

    其中利用curl_error()获取错误信息,curl_getinfo()获取运行相关信息。

    实例四  上传图片,获取返回信息。

    跨域上传图片,同时获取返回信息,这个就能大显身手。和post比较像,注意文件之前加一个@符号

    <?php
    $uri = "http://localhost/tqj/date/p822.php";
    
    // post参数数组
    $data = array (
            'author' => 'tianquanjun',
            'upload' => '@C:\Users\tianquanjun.DANGDANG\Pictures\a.jpg',
    );
    
    //初始化
    $ch = curl_init ();
    
    //各种项设置,网上参考而来,可以查看php手册,自己设置
    curl_setopt ( $ch, CURLOPT_URL, $uri );
    curl_setopt ( $ch, CURLOPT_POST, 1 );//post方式
    curl_setopt ( $ch, CURLOPT_HEADER, 0 );
    curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
    curl_setopt ( $ch, CURLOPT_POSTFIELDS, $data );
    
    //执行
    $return = curl_exec ( $ch );
    
    //容错机制
    if($return === false){
        var_dump(curl_error($ch));
        }
    
    //curl_getinfo()获取各种运行中信息,便于调试 
    $info = curl_getinfo($ch);
    
    echo "执行时间".$info['total_time'].PHP_EOL;
    
    //释放
    curl_close ( $ch );
    
    print_r($return);
    ?>

    实例五 : curl批处理。

      curl有一个高级特性,批处理句柄。允许打开多个curl链接。 

      批处理就是打开多个curl句柄,并把这些句柄指派给一个批处理句柄,然后在while循环里等待处理完毕。curl_multi_exec()算是称得上多线程处理,不过它还是属于异步的范畴。

    <?php
    header("Content-type: text/html; charset=gbk");
    $urls=array('http://www.baidu.com','http://www.qq.com/');
    $ch=array();
    //批处理句柄
    $mh=curl_multi_init();
    
    //打开多个curl句柄,并指派给一个批处理句柄
    $ch[0]=curl_init($urls[0]);
    $ch[1]=curl_init($urls[1]);
    for($i=0;$i<2;$i++)
    {
    curl_setopt($ch[$i],CURLOPT_RETURNTRANSFER,1);
    curl_multi_add_handle($mh,$ch[$i]);
    
    }
    $running = NULL;
    do{
        usleep(10000);
        curl_multi_exec($mh,$running);//实现批处理,可以看做curl多线程,实际是异步范畴
    }while($running>0);
    $res=array();
    for($j=0;$j<2;$j++)
    {
        $res[$j]=curl_multi_getcontent($ch[$j]);
    }
    
    //关闭句柄
    for($k=0;$k<2;$k++)
    {
        curl_multi_remove_handle($mh,$ch[$k]);
    }
    curl_multi_close($mh);
    
    print_r($res);
    
    
    ?>

    基本算是列举了常用的一些实例。要想灵活运用curl,还是得熟悉curl的各个设置项,这些设置项才是curl的灵魂。

    ==========================亲测效果===============================================

    getwether.php

    <?php
    $data = "theCityName=邯郸";
    $uri = "http://www.webxml.com.cn/WebServices/WeatherWebService.asmx/getWeatherbyCityName";
    
    //初始化
    $obj = curl_init();
    
    //设置
    curl_setopt($obj, CURLOPT_URL, $uri);
    curl_setopt($obj, CURLOPT_HEADER, 0);  //将头文件的信息作为数据流输出
    curl_setopt($obj, CURLOPT_RETURNTRANSFER, 1); //执行后直接返回
    curl_setopt($obj, CURLOPT_POST, 1);  //post 方式
    curl_setopt($obj, CURLOPT_POSTFIELDS, $data);  //发送post请求参数
    curl_setopt($obj,CURLOPT_USERAGENT, " user-agent:Mozilla/5.0 (Windows NT 6.1; rv:62.0) Gecko/20100101 Firefox/62.0");//浏览器头信息
    curl_setopt($obj, CURLOPT_HTTPHEADER, array("application/x-www-form-urlencoded;charset=utf-8", "Content-Length:" . strlen($data))); //发送header头信息
    
    $opt = curl_exec($obj);
    
    
    if ($opt === false) {
        var_dump(curl_error($obj));
    } else {
        var_dump(curl_errno($obj));//int(0)
    
        $info = curl_getinfo($obj);
        echo '执行时间:'.$info['total_time'] . PHP_EOL;
    //    echo $opt;
        print_r($opt);
    }
    
    curl_close($obj);
    var_dump(curl_errno($obj));//int(0)        返回最后一次的错误号
    var_dump(curl_error($obj)); //string(0) "" 返回一个保护当前会话最近一次错误的字符串

    在cmd命令行中输入:

    php -f getwether.php >wether.txt
    int(0)
    执行时间:0.187
    <?xml version="1.0" encoding="utf-8"?>
    <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://WebXml.com.cn/">
      <string>河北</string>
      <string>邯郸</string>
      <string>53892</string>
      <string>53892.jpg</string>
      <string>2018/10/17 22:45:23</string>
      <string>8℃/19℃</string>
      <string>10月17日 多云</string>
      <string>北风小于3级</string>
      <string>1.gif</string>
      <string>1.gif</string>
      <string>今日天气实况:气温:12℃;风向/风力:北风 1级;湿度:77%;紫外线强度:弱。空气质量:中。</string>
      <string>紫外线指数:弱,辐射较弱,涂擦SPF12-15、PA+护肤品。
    健臻·血糖指数:易波动,血糖易波动,注意监测。
    穿衣指数:较舒适,建议穿薄外套或牛仔裤等服装。
    洗车指数:较适宜,无雨且风力较小,易保持清洁度。
    空气污染指数:中,易感人群应适当减少室外活动。
    </string>
      <string>8℃/18℃</string>
      <string>10月18日 多云</string>
      <string>南风小于3级</string>
      <string>1.gif</string>
      <string>1.gif</string>
      <string>9℃/19℃</string>
      <string>10月19日 多云</string>
      <string>南风小于3级</string>
      <string>1.gif</string>
      <string>1.gif</string>
      <string>邯郸市是河北省最古老的城市,也是我国古代著名的城邑。早在2000多年前的春秋初期,就有邯郸的建制,当时邯郸已是一个人口聚居的城市。战国时作为赵国都城历经158年,秦统一后分别设邯郸县、邯郸郡。当时的邯郸经济昌盛、繁荣发达,与长安、洛阳、开封、成都同称五大都城。邯郸位于河北省南部,地处太行山东麓、淦阳河上,是晋冀鲁豫四省接壤的腹地。邯郸市位于太行山东麓,属暖温带半湿润半干旱大陆季风性气候。特点是四季分明,雨量适中,秋、春两季短,冬、夏两季长。邯郸市的自然环境得天独厚,西倚太行山,东临滏阳河,地势西北高、东南低,中部丘陵起伏,盆地交错;并有沁河、渚河、输元河流经市区(皆属滏阳河支流),丰富的水利资源为农业生产提供了优良的条件。景观:黄梁梦吕仙祠、永年君臣上寿石刻、学步桥、磁州窑、古邺城、兰陵王墓、天子冢、响堂山石窟、磁山古文化遗址等。</string>
    </ArrayOfString>

     ====================爬去豆瓣电影api==================================

    <?php
    
    $uri="https://api.douban.com/v2/movie/in_theaters";
    $data="city=邯郸&start=0&count=3";
    
    $obj=curl_init();
    
    curl_setopt($obj,CURLOPT_URL,$uri);
    curl_setopt($obj,CURLOPT_RETURNTRANSFER,1);
    curl_setopt($obj,CURLOPT_POSTFIELDS,$data);
    curl_setopt($obj,CURLOPT_POST,1);
    curl_setopt($obj,CURLOPT_SSL_VERIFYPEER,0);
    $opt=curl_exec($obj);
    
    if($opt===false){
        var_dump(curl_error($obj));
    }else{
        $info=curl_getinfo($obj);
       /* echo '<pre>';
        print_r($info);
        echo '</pre>';*/
    
       $movies=json_decode($opt,true);
        echo count($movies);
        echo '<pre>';
        print_r($movies);
        echo '</pre>';
    }
    curl_close($obj);

    结果:

    5
    
    Array
    (
        [count] => 3
        [start] => 0
        [total] => 21
        [subjects] => Array
            (
                [0] => Array
                    (
                        [rating] => Array
                            (
                                [max] => 10
                                [average] => 8.1
                                [stars] => 40
                                [min] => 0
                            )
    
                        [genres] => Array
                            (
                                [0] => 剧情
                                [1] => 动作
                                [2] => 犯罪
                            )
    
                        [title] => 无双
                        [casts] => Array
                            (
                                [0] => Array
                                    (
                                        [alt] => https://movie.douban.com/celebrity/1044899/
                                        [avatars] => Array
                                            (
                                                [small] => https://img1.doubanio.com/view/celebrity/s_ratio_celebrity/public/p35678.jpg
                                                [large] => https://img1.doubanio.com/view/celebrity/s_ratio_celebrity/public/p35678.jpg
                                                [medium] => https://img1.doubanio.com/view/celebrity/s_ratio_celebrity/public/p35678.jpg
                                            )
    
                                        [name] => 周润发
                                        [id] => 1044899
                                    )
    
                                [1] => Array
                                    (
                                        [alt] => https://movie.douban.com/celebrity/1041390/
                                        [avatars] => Array
                                            (
                                                [small] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p49475.jpg
                                                [large] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p49475.jpg
                                                [medium] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p49475.jpg
                                            )
    
                                        [name] => 郭富城
                                        [id] => 1041390
                                    )
    
                                [2] => Array
                                    (
                                        [alt] => https://movie.douban.com/celebrity/1016668/
                                        [avatars] => Array
                                            (
                                                [small] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p146.jpg
                                                [large] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p146.jpg
                                                [medium] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p146.jpg
                                            )
    
                                        [name] => 张静初
                                        [id] => 1016668
                                    )
    
                            )
    
                        [collect_count] => 325710
                        [original_title] => 無雙
                        [subtype] => movie
                        [directors] => Array
                            (
                                [0] => Array
                                    (
                                        [alt] => https://movie.douban.com/celebrity/1014716/
                                        [avatars] => Array
                                            (
                                                [small] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p3555.jpg
                                                [large] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p3555.jpg
                                                [medium] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p3555.jpg
                                            )
    
                                        [name] => 庄文强
                                        [id] => 1014716
                                    )
    
                            )
    
                        [year] => 2018
                        [images] => Array
                            (
                                [small] => https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2535096871.jpg
                                [large] => https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2535096871.jpg
                                [medium] => https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2535096871.jpg
                            )
    
                        [alt] => https://movie.douban.com/subject/26425063/
                        [id] => 26425063
                    )
    
                [1] => Array
                    (
                        [rating] => Array
                            (
                                [max] => 10
                                [average] => 7.4
                                [stars] => 40
                                [min] => 0
                            )
    
                        [genres] => Array
                            (
                                [0] => 剧情
                                [1] => 动作
                                [2] => 武侠
                            )
    
                        [title] => 影
                        [casts] => Array
                            (
                                [0] => Array
                                    (
                                        [alt] => https://movie.douban.com/celebrity/1274235/
                                        [avatars] => Array
                                            (
                                                [small] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p805.jpg
                                                [large] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p805.jpg
                                                [medium] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p805.jpg
                                            )
    
                                        [name] => 邓超
                                        [id] => 1274235
                                    )
    
                                [1] => Array
                                    (
                                        [alt] => https://movie.douban.com/celebrity/1004856/
                                        [avatars] => Array
                                            (
                                                [small] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p1415690807.36.jpg
                                                [large] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p1415690807.36.jpg
                                                [medium] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p1415690807.36.jpg
                                            )
    
                                        [name] => 孙俪
                                        [id] => 1004856
                                    )
    
                                [2] => Array
                                    (
                                        [alt] => https://movie.douban.com/celebrity/1275564/
                                        [avatars] => Array
                                            (
                                                [small] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p1366015827.84.jpg
                                                [large] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p1366015827.84.jpg
                                                [medium] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p1366015827.84.jpg
                                            )
    
                                        [name] => 郑恺
                                        [id] => 1275564
                                    )
    
                            )
    
                        [collect_count] => 255137
                        [original_title] => 影
                        [subtype] => movie
                        [directors] => Array
                            (
                                [0] => Array
                                    (
                                        [alt] => https://movie.douban.com/celebrity/1054398/
                                        [avatars] => Array
                                            (
                                                [small] => https://img1.doubanio.com/view/celebrity/s_ratio_celebrity/public/p568.jpg
                                                [large] => https://img1.doubanio.com/view/celebrity/s_ratio_celebrity/public/p568.jpg
                                                [medium] => https://img1.doubanio.com/view/celebrity/s_ratio_celebrity/public/p568.jpg
                                            )
    
                                        [name] => 张艺谋
                                        [id] => 1054398
                                    )
    
                            )
    
                        [year] => 2018
                        [images] => Array
                            (
                                [small] => https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2530513100.jpg
                                [large] => https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2530513100.jpg
                                [medium] => https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2530513100.jpg
                            )
    
                        [alt] => https://movie.douban.com/subject/4864908/
                        [id] => 4864908
                    )
    
                [2] => Array
                    (
                        [rating] => Array
                            (
                                [max] => 10
                                [average] => 5.1
                                [stars] => 25
                                [min] => 0
                            )
    
                        [genres] => Array
                            (
                                [0] => 喜剧
                            )
    
                        [title] => 李茶的姑妈
                        [casts] => Array
                            (
                                [0] => Array
                                    (
                                        [alt] => https://movie.douban.com/celebrity/1363857/
                                        [avatars] => Array
                                            (
                                                [small] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p1519453932.46.jpg
                                                [large] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p1519453932.46.jpg
                                                [medium] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p1519453932.46.jpg
                                            )
    
                                        [name] => 黄才伦
                                        [id] => 1363857
                                    )
    
                                [1] => Array
                                    (
                                        [alt] => https://movie.douban.com/celebrity/1350408/
                                        [avatars] => Array
                                            (
                                                [small] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p1437031126.82.jpg
                                                [large] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p1437031126.82.jpg
                                                [medium] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p1437031126.82.jpg
                                            )
    
                                        [name] => 艾伦
                                        [id] => 1350408
                                    )
    
                                [2] => Array
                                    (
                                        [alt] => https://movie.douban.com/celebrity/1350407/
                                        [avatars] => Array
                                            (
                                                [small] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p1437031175.04.jpg
                                                [large] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p1437031175.04.jpg
                                                [medium] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p1437031175.04.jpg
                                            )
    
                                        [name] => 宋阳
                                        [id] => 1350407
                                    )
    
                            )
    
                        [collect_count] => 112833
                        [original_title] => 李茶的姑妈
                        [subtype] => movie
                        [directors] => Array
                            (
                                [0] => Array
                                    (
                                        [alt] => https://movie.douban.com/celebrity/1313050/
                                        [avatars] => Array
                                            (
                                                [small] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p1518587170.5.jpg
                                                [large] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p1518587170.5.jpg
                                                [medium] => https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p1518587170.5.jpg
                                            )
    
                                        [name] => 吴昱翰
                                        [id] => 1313050
                                    )
    
                            )
    
                        [year] => 2018
                        [images] => Array
                            (
                                [small] => https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2533384240.jpg
                                [large] => https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2533384240.jpg
                                [medium] => https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2533384240.jpg
                            )
    
                        [alt] => https://movie.douban.com/subject/27092785/
                        [id] => 27092785
                    )
    
            )
    
        [title] => 正在上映的电影-邯郸
    )

    curl_getinfo函数获得信息:

    =============================================curl获得慕课用户信息=================================================

    <?php
    //C:\phpStudy\PHPTutorial\WWW\curl
    
    date_default_timezone_set('PRC');
    
    
    $data="username=用户名&password=密码&remember=1";
    //15510485900 
    
    $httpHeader=["Content-Type: application/x-www-form-urlencoded; charset=utf-8","Content-length:".strlen($data)];
    $obj=curl_init();
    curl_setopt($obj,CURLOPT_URL,"https://www.imooc.com/user/login");
    //curl_setopt($obj,CURLOPT_URL,"https://login.sina.com.cn/sso/login.php?client=ssologin.js(v1.4.19)");
    curl_setopt($obj,CURLOPT_RETURNTRANSFER,1);
    
    
    
    curl_setopt($obj,CURLOPT_COOKIESESSION,true);
    curl_setopt($obj,CURLOPT_COOKIEFILE,'cookiefile');
    curl_setopt($obj,CURLOPT_COOKIEJAR,'cookiefile');
    curl_setopt($obj,CURLOPT_COOKIE,session_name().'='.session_id());
    
    curl_setopt($obj,CURLOPT_HEADER,0);
    curl_setopt($obj,CURLOPT_FOLLOWLOCATION,1);
    curl_setopt($obj,CURLOPT_SSL_VERIFYPEER,false);//不需要认证
    curl_setopt($obj,CURLOPT_POST,1);
    curl_setopt($obj,CURLOPT_POSTFIELDS,$data);
    curl_setopt($obj,CURLOPT_HTTPHEADER,$httpHeader);
    curl_setopt($obj, CURLOPT_TIMEOUT, 300);
    $return=curl_exec($obj);
    
    if($return===false){
        var_dump(curl_error($obj));
    }else{
        var_dump(curl_error($obj));
        var_dump(curl_errno($obj));
    }
    //echo $return;
    //curl_close($obj);
    //echo 'ceshi ';
    //die;
    curl_setopt($obj,CURLOPT_URL,"https://www.imooc.com/u/5510462/courses");
    //curl_setopt($obj,CURLOPT_URL,"https://weibo.com/5549088156/profile?topnav=1&wvr=6&is_all=1");
    
    curl_setopt($obj,CURLOPT_POST,0);
    curl_setopt($obj,CURLOPT_HTTPHEADER,array("Content-type:text/xml;"));
    $opt=curl_exec($obj);
    
    /*if($opt===false){
        var_dump(curl_error($obj));
    }else{
        var_dump(curl_error($obj));
        var_dump(curl_errno($obj));
    }*/
    
    curl_close($obj);
    
    echo $opt;

    结果:

    string(0) ""
    int(0)
    
    
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>青春阳光爱伟的课程</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta name="renderer" content="webkit" />
    
    <meta property="qc:admins" content="77103107776157736375" />
    <meta property="wb:webmaster" content="c4f857219bfae3cb" />
    <meta http-equiv="Access-Control-Allow-Origin" content="*" />
    <meta http-equiv="Cache-Control" content="no-transform " />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="dns-prefetch" href="//www.imooc.com" />
    <link rel="dns-prefetch" href="//img.imooc.com" />
    <link rel="dns-prefetch" href="//img.mukewang.com" />
    <link rel="apple-touch-icon" sizes="76x76" href="/static/img/common/touch-icon-ipad.png">
    <link rel="apple-touch-icon" sizes="120x120" href="/static/img/common/touch-icon-iphone-retina.png">
    <link rel="apple-touch-icon" sizes="152x152" href="/static/img/common/touch-icon-ipad-retina.png">
    <meta name="keywords" content="慕课网,慕课官网,MOOC,移动开发,IT技能培训,免费编程视频,php开发教程,web前端开发,在线编程学习,html5视频教程,css教程,ios开发培训,安卓开发教程" />
    <meta name="description" content="慕课网(IMOOC)是学习编程最简单的免费平台。慕课网提供了丰富的移动端开发、php开发、web前端、html5教程以及css3视频教程等课程资源。它富有交互性及趣味性,并且你可以和朋友一起编程。" />
    
    
    
    
    
    
    
    
    <link rel="stylesheet" href="/static/moco/v1.0/dist/css/moco.min.css?t=201810221819" type="text/css" />
        <link rel="stylesheet" href="/static/lib/swiper/swiper-3.4.2.min.css?t=201810221819">
    
    <script type="text/javascript">
    
    eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1;};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p;}('!4(){3 a={};3 c=0;3 5=[{d:\'//o.q.g/o/p/K/J.r\',6:0},{d:\'//p.q.g/I/L-O.r\',6:0}];3 w=4(){3 j,s=e N("(^| )"+"k=([^;]*)(;|$)");8(j=u.l.M(s)){m H(j[2])}E{m z}};3 y=4(t){3 n=w();3 b=e F();b.G(b.D()+13*v*v*10);u.l="k="+t+";14="+b.R()+";S=/;P=Q.g";8(t&&t!=n){X.U.V()}};3 C=4(i){3 7=e W();7.T=4(){12(a[i]);a[i]=z;9(i,0)};7.Z=4(){9(i,1)};a[i]=11(4(){7.B="";9(i,1)},Y);7.B=5[i].d};3 9=4(x,6){c++;5[x].6=6;8(c==5.f){3 h=0;A(3 i=0;i<5.f;i++){8(5[i].6==1){h=1}}y(h)}};A(3 i=0;i<5.f;i++){C(i)}}()',62,67,'|||var|function|urls|flag|imgobj|if|callback|timer|exp|count|url|new|length|com|error||arr|IMCDNS|cookie|return|_0|static|img|mukewang|png|reg||document|60|getcookie|index|setcookie|null|for|src|checkCdn|getTime|else|Date|setTime|unescape|images|logo|common|unknow|match|RegExp|80|domain|imooc|toGMTString|path|onload|location|reload|Image|window|3000|onerror|1000|setTimeout|clearTimeout|24|expires'.split('|'),0,{}))
    
    </script>
    
    
    <script type="text/javascript">
    
    var OP_CONFIG={"module":"u","page":"courses"};
    var isLogin = 0;
    var is_choice = "";
    var seajsTimestamp="v=201810221819";
    var _msg_unread = 0; 
    var _not_unread = 0; 
    var _cart_num = 0;
    </script>
    
    
    
    
    
    <link rel="stylesheet" href="/static/lib/layer/1.6.0/skin/layer.css" />
    
    
    
    <link rel="stylesheet" href="//static.mukewang.com/static/css/??base.css,common/common-less.css?t=2.5,u/u_common_new-less.css,u/courses/time-less.css?v=201810221819" type="text/css" />
    </head>
    
    <body >
        
    
    <div id="header">
        <div class="page-container" id="nav"  >
             <div id="logo" class="logo"><a href="/" target="_self" class="hide-text" title="首页">慕课网</a></div>
          
    
            <button type="button" class="navbar-toggle visible-xs-block js-show-menu" >
                <i class="icon-menu"></i>
            </button>
            <ul class="nav-item">
                            <li class="set-btn visible-xs-block"><a href="/user/newlogin" target="_self">登录</a> / <a href="/user/newsignup" target="_self">注册</a></li>
                            
                <li>
                    <a href="/course/list"  target="_self">免费课程</a>
                </li>  
                <li>
                    <a href="//coding.imooc.com" target="_self">实战课程</a>
                </li>         
                <li><a href="//class.imooc.com" class="" target="_self">就业班</a></li>
                
                <li><a href="/wenda"  target="_self">猿问</a></li>
                <li><a href="/article"  target="_self">手记</a></li>
                <li><a href="//job.imooc.com" class="program-nav" target="_self">猿聘<i class="icn-new"></i></a></li>
                
            </ul>
                    <div id="login-area">
                <ul class="header-unlogin clearfix">
                    <li class="app-load" id="js-app-load">
                        <a href="//www.imooc.com/mobile/app" target="_blank" style="60px;">下载APP</a>
                        <div class="app-load-box clearfix js-load-box">
                            <img src="/static/img/common/appload.png" class="l">
                            <div class="r">
                                <p>扫描下载慕课网APP</p>
                                <a href="https://itunes.apple.com/cn/app/mu-ke-wang/id722179140?mt=8" target="_blank"><i class="icon-apple"></i>App Store下载</a>
                                <a href="//www.imooc.com/mobile/mukewang.apk" target="_blank"><i class="icon-android"></i>Android下载</a>
                            </div>
                        </div>
                    </li>
    
                    <li class="shop-cart" id="shop-cart">
                        <a href="//order.imooc.com/pay/cart" class="shop-cart-icon" target="_blank">
                            <span class="icon-shopping-cart js-endcart"></span><span>购物车</span><span class="shopping_icon js-cart-num" data-ordernum="0"  data-cartnum="0" style='display: none'>0</span>
                        </a>
                        <div class="my-cart" id="js-my-cart"></div>
                    </li>             
                    <li class="header-signin">
                        <a href="//www.imooc.com/user/newlogin" id="js-signin-btn">登录</a> / <a href="//www.imooc.com/user/newsignup" id="js-signup-btn">注册</a>
                    </li>             
                </ul>
            </div>
                    <div class='search-warp clearfix' style='min- 32px; height: 72px;'>
                                <div class="pa searchTags" >
                                        <a href="//class.imooc.com/sc/20" target="_blank">前端入门</a>
                                        <a href="//class.imooc.com/sc/18" target="_blank">Java基础</a>
                                    </div>
                
                <div class="search-area" data-search="top-banner">
                    <input class="search-input" data-suggest-trigger="suggest-trigger"      type="text" autocomplete="off">
                    <input type='hidden' class='btn_search' data-search-btn="search-btn" />
                    <ul class="search-area-result" data-suggest-result="suggest-result">
                    </ul>
                </div>
                <div class='showhide-search' data-show='no'><i class='icon-search'></i></div>
            </div>
        </div>
    </div>
    
    <!-- 新人有礼入口 -->
    <a class="newcomer index hide" href="//www.imooc.com/act/newcomer" target="_blank">
        <i class="js-close imv2-close"></i>
        
    </a>
    
    <div class="bindHintBox js-bindHintBox hide">
        <div class="pr">
            为了账号安全,请及时绑定邮箱和手机<a href="/user/setbindsns" class="ml20 color-red" target="_blank">立即绑定</a>
            <button  class="closeBindHint js-closeBindHint" type="button"></button>
            <div class="arrow"> </div>
        </div>
    </div>
    
    
    <div id="main">
    
    <div class="bg-other user-head-info">
        <div class="user-info clearfix">
            <div class="user-pic" data-is-fans="" data-is-follows="">
                <div class="user-pic-bg">
                    <img class='img' src="//img3.mukewang.com/533e4c420001b2e502000200-140-140.jpg" alt=""/>
                </div><!--user-pic-big end-->            
            </div>
            <div class="user-info-right">
                <h3 class="user-name clearfix">
                    <span>青春阳光爱伟</span>
                                                                </h3>
                <!--25-->
                <p class="about-info">
                    <span>男</span>
                                    <span>北京</span>
                     
                                                                                 
                                        <span>
                        PHP开发工程师
                        </span>
                                    <a class="more-user-info"><i class="imv2-arrow2_d"></i>更多信息</a>
                </p>
            </div>
            <div class="user-sign hide">
                            <p class="user-desc" title="努力学习">努力学习</p>
                        </div>
            <div class="study-info clearfix">
                    <div class="item follows">
                                            <div class="u-info-learn" title="学习时长167小时26分" style="cursor:pointer;">
                                                        <em>167h</em>
                                <span>学习时长 </span>
                                                </div>
                                        </div>
                    <div class="item follows">
                                            <em>3532</em>
                                        
                        <span>经验</span>
                    </div>
                    <div class="item follows">
                                            <em>2</em>
                                        
                        <span>积分</span>
                    </div>
                                <div class="item follows">
                                            <a href='/u/5510462/follows'><em>2</em></a>
                                        
                        <span>关注</span>
                    </div>
                    <div class="item follows">
                                                <a href='/u/5510462/fans'><em>0</em></a>
                                            <span>粉丝</span>
                    </div>
                                 
                   
                    
                       <div class="item js-u-add-follow hide" data-uid='5510462' data-type="1" >
                            <a class="status-btn add-follow "><i class="icon-add">+</i>关注</a>
                       </div>
                                          <div class="item js-u-already-follow hide" data-uid='5510462' data-type="2">
                            <a class="status-btn already-follow"><i class="imv2-check"></i>已关注</a>
                        </div>
                                            <div class="item js-fans-msg hide" data-uid='5510462' data-type="3">
                            <a class="status-btn add-follow" >私信</a>
                        </div>
                            </div><!--.study-info end-->
        </div><!-- .user-info end -->
    </div><!-- .big-pic end -->
    <div class="wrap">
            
    <div class="slider">
        <ul>
    
                
                 
             <li>
                <a href="/u/5510462" >
                <i class="icon-home"></i><span>动态圈</span><b class="icon-drop_right"></b>
                </a>
            </li>
            
        
                     
                     
                <li>
                <a href="/u/5510462/courses" class="active">
                <i class="icon-tick"></i><span>免费课程</span><b class="icon-drop_right"></b>
                </a>
            </li>     
                         
                 <li>
                <a href="/u/5510462/plans" >
                <i class="imv2-path"></i><span>职业路径</span><b class="icon-drop_right"></b>
                </a>
             </li>
                         
                    
                                      
                <li>
                <a href="/u/5510462/bbs" >
                    <i class="icon-yuanwen"></i><span>猿问</span><b class="icon-drop_right"></b>
                </a>
            </li>
                         
                <li>
                <a href="/u/5510462/articles" >
                <i class="icon-blog"></i><span>手记</span><b class="icon-drop_right"></b>
                </a>
            </li>
                         
        
             
        </ul>
    </div><!-- .slider end -->    <div class="u-container">
         <div class="c-tab clearfix">
        <div class="tool-left l">
           
                     <a href="/u/5510462/courses" class="sort-item active">最近学习</a>
            
            
    
            
        </div>
        <div class="tool-right r">
            <div class="tool-all">
                <span id="js-columall" class="tool-item">
                    <span>
    
                                                                        全部课程
                                            
                    </span>
                    <i class="tool-item icon icon-drop_down"></i>
                </span>
                <ul id="js-columbd" class="all-cont" style="display:none;">
    
                                                                                                            <li><a data-id="0" href="/u/5510462/courses?sort=time&skill_id=0">全部课程</a></li>
                                                                <li><a data-id="1" href="/u/5510462/courses?sort=time&skill_id=1">PHP</a></li>
                                                                <li><a data-id="220" href="/u/5510462/courses?sort=time&skill_id=220">Java</a></li>
                                                                <li><a data-id="468" href="/u/5510462/courses?sort=time&skill_id=468">Linux</a></li>
                                                                <li><a data-id="952" href="/u/5510462/courses?sort=time&skill_id=952">MySQL</a></li>
                                                                <li><a data-id="1118" href="/u/5510462/courses?sort=time&skill_id=1118">Python</a></li>
                                                                <li><a data-id="4917" href="/u/5510462/courses?sort=time&skill_id=4917">Redis</a></li>
                                                                <li><a data-id="5272" href="/u/5510462/courses?sort=time&skill_id=5272">爬虫</a></li>
                                                            <li><a href="/u/5510462/courses?sort=time">全部课程</a></li>
                                                        </ul>
    
            </div>
        </div>
    </div>
    
        <div class="js-course-list my-space-course study-tl">
                    <div class="clearfix tl-item  tl-item-first">
                            <span class="time">
                    <b>2018</b>
                    <em>10月22日</em>
                </span>
                <div class="course-list course-list-m">
                    <ul class="clearfix">
                                            <li class="course-one" data-courseid="132" data-uid="5510462">
                            <div class="course-list-img l">
                                <a href="/learn/132" target="_blank">
                                    <img width="200" height="113" alt="PHP中的数据传输神器cURL" src="//img.mukewang.com/570762be0001898506000338-240-135.jpg" />
                                </a>
                            </div>
                            <div class="course-list-cont">
                                <h3 class="study-hd">
                                    <a href="/learn/132" target="_blank">PHP中的数据传输神器cURL</a>
    
                                                                                                                <span class="i-new">更新完毕</span>
                                        <!-- 更新完毕 -->
                                                                                                        <!-- 收藏和删除 -->
                                                                </h3>
                                                            <div class="study-points">
                                    <span class="i-left span-common">已学70%</span>
                                    <span class="i-mid span-common">用时 5小时 7分</span>
                                    <span class="i-right span-common">学习至2-4 用cURL登陆慕课网并下载个人空间页面</span>
                                </div>
                                                            <div class="catog-points">
                                    <span class="i-left span-common"><a href="/u/5510462/notepad/132">笔记 <i>0</i></a></span>
                                    <span class="i-mid span-common"><a href="/u/5510462/course/132/codes">代码 <i>0</i></a></span>
                                    <span class="i-right span-common"><a href="/u/5510462/course/132/questions">问答 <i>0</i></a></span>
    
                                    
                                </div>
                            </div>
                            
                            
                        </li>
                                        </ul>
                </div>
            </div>
    
                    <div class="clearfix tl-item ">
                            <span class="time">
                    <b>2018</b>
                    <em>10月14日</em>
                </span>
                <div class="course-list course-list-m">
                    <ul class="clearfix">
                                            <li class="course-one" data-courseid="68" data-uid="5510462">
                            <div class="course-list-img l">
                                <a href="/learn/68" target="_blank">
                                    <img width="200" height="113" alt="JSON应用场景与实战" src="//img.mukewang.com/578386af00010eea06000338-240-135.jpg" />
                                </a>
                            </div>
                            <div class="course-list-cont">
                                <h3 class="study-hd">
                                    <a href="/learn/68" target="_blank">JSON应用场景与实战</a>
    
                                                                                                                <span class="i-new">更新完毕</span>
                                        <!-- 更新完毕 -->
                                                                                                        <!-- 收藏和删除 -->
                                                                </h3>
                                                            <div class="study-points">
                                    <span class="i-left span-common">已学0%</span>
                                    <span class="i-mid span-common">用时 1分</span>
                                    <span class="i-right span-common">学习至1-4 练习</span>
                                </div>
                                                            <div class="catog-points">
                                    <span class="i-left span-common"><a href="/u/5510462/notepad/68">笔记 <i>0</i></a></span>
                                    <span class="i-mid span-common"><a href="/u/5510462/course/68/codes">代码 <i>0</i></a></span>
                                    <span class="i-right span-common"><a href="/u/5510462/course/68/questions">问答 <i>0</i></a></span>
    
                                    
                                </div>
                            </div>
                            
                            
                        </li>
                                        </ul>
                </div>
            </div>
    
                    <div class="clearfix tl-item ">
                            <span class="time">
                    <b>2018</b>
                    <em>10月10日</em>
                </span>
                <div class="course-list course-list-m">
                    <ul class="clearfix">
                                            <li class="course-one" data-courseid="845" data-uid="5510462">
                            <div class="course-list-img l">
                                <a href="/learn/845" target="_blank">
                                    <img width="200" height="113" alt="SVN从入门到放弃" src="//img.mukewang.com/5934bac20001a5c906000338-240-135.jpg" />
                                </a>
                            </div>
                            <div class="course-list-cont">
                                <h3 class="study-hd">
                                    <a href="/learn/845" target="_blank">SVN从入门到放弃</a>
    
                                                                                                                  <span class="i-new">更新至6-1</span>
                                                                                                        <!-- 收藏和删除 -->
                                                                </h3>
                                                            <div class="study-points">
                                    <span class="i-left span-common">已学19%</span>
                                    <span class="i-mid span-common">用时53分</span>
                                    <span class="i-right span-common">学习至6-1 常见坑与总结</span>
                                </div>
                                                            <div class="catog-points">
                                    <span class="i-left span-common"><a href="/u/5510462/notepad/845">笔记 <i>0</i></a></span>
                                    <span class="i-mid span-common"><a href="/u/5510462/course/845/codes">代码 <i>0</i></a></span>
                                    <span class="i-right span-common"><a href="/u/5510462/course/845/questions">问答 <i>0</i></a></span>
    
                                    
                                </div>
                            </div>
                            
                            
                        </li>
                                            <li class="course-one" data-courseid="109" data-uid="5510462">
                            <div class="course-list-img l">
                                <a href="/learn/109" target="_blank">
                                    <img width="200" height="113" alt="版本管理工具介绍---SVN篇" src="//img.mukewang.com/570360980001a2de06000338-240-135.jpg" />
                                </a>
                            </div>
                            <div class="course-list-cont">
                                <h3 class="study-hd">
                                    <a href="/learn/109" target="_blank">版本管理工具介绍---SVN篇</a>
    
                                                                                                                <span class="i-new">更新完毕</span>
                                        <!-- 更新完毕 -->
                                                                                                        <!-- 收藏和删除 -->
                                                                </h3>
                                                            <div class="study-points">
                                    <span class="i-left span-common">已学43%</span>
                                    <span class="i-mid span-common">用时21分</span>
                                    <span class="i-right span-common">学习至4-3 SVN 常见问题 Ⅲ</span>
                                </div>
                                                            <div class="catog-points">
                                    <span class="i-left span-common"><a href="/u/5510462/notepad/109">笔记 <i>0</i></a></span>
                                    <span class="i-mid span-common"><a href="/u/5510462/course/109/codes">代码 <i>0</i></a></span>
                                    <span class="i-right span-common"><a href="/u/5510462/course/109/questions">问答 <i>0</i></a></span>
    
                                    
                                </div>
                            </div>
                            
                            
                        </li>
                                        </ul>
                </div>
            </div>
    
                    <div class="clearfix tl-item ">
                            <span class="time">
                    <b>2018</b>
                    <em>09月09日</em>
                </span>
                <div class="course-list course-list-m">
                    <ul class="clearfix">
                                            <li class="course-one" data-courseid="533" data-uid="5510462">
                            <div class="course-list-img l">
                                <a href="/learn/533" target="_blank">
                                    <img width="200" height="113" alt="MySQL5.7版本新特性" src="//img.mukewang.com/572afe280001c13406000338-240-135.jpg" />
                                </a>
                            </div>
                            <div class="course-list-cont">
                                <h3 class="study-hd">
                                    <a href="/learn/533" target="_blank">MySQL5.7版本新特性</a>
    
                                                                                                                <span class="i-new">更新完毕</span>
                                        <!-- 更新完毕 -->
                                                                                                        <!-- 收藏和删除 -->
                                                                </h3>
                                                            <div class="study-points">
                                    <span class="i-left span-common">已学0%</span>
                                    <span class="i-mid span-common">用时 0分</span>
                                    <span class="i-right span-common">学习至1-3 旧版本支持为表增加计算列演练</span>
                                </div>
                                                            <div class="catog-points">
                                    <span class="i-left span-common"><a href="/u/5510462/notepad/533">笔记 <i>0</i></a></span>
                                    <span class="i-mid span-common"><a href="/u/5510462/course/533/codes">代码 <i>0</i></a></span>
                                    <span class="i-right span-common"><a href="/u/5510462/course/533/questions">问答 <i>0</i></a></span>
    
                                    
                                </div>
                            </div>
                            
                            
                        </li>
                                        </ul>
                </div>
            </div>
    
                    <div class="clearfix tl-item ">
                            <span class="time">
                    <b>2018</b>
                    <em>08月20日</em>
                </span>
                <div class="course-list course-list-m">
                    <ul class="clearfix">
                                            <li class="course-one" data-courseid="177" data-uid="5510462">
                            <div class="course-list-img l">
                                <a href="/learn/177" target="_blank">
                                    <img width="200" height="113" alt="初识Python" src="//img.mukewang.com/540e57300001d6d906000338-240-135.jpg" />
                                </a>
                            </div>
                            <div class="course-list-cont">
                                <h3 class="study-hd">
                                    <a href="/learn/177" target="_blank">初识Python</a>
    
                                                                                                                <span class="i-new">更新完毕</span>
                                        <!-- 更新完毕 -->
                                                                                                        <!-- 收藏和删除 -->
                                                                </h3>
                                                            <div class="study-points">
                                    <span class="i-left span-common">已学6%</span>
                                    <span class="i-mid span-common">用时 1小时44分</span>
                                    <span class="i-right span-common">学习至4-7 Python之创建tuple</span>
                                </div>
                                                            <div class="catog-points">
                                    <span class="i-left span-common"><a href="/u/5510462/notepad/177">笔记 <i>0</i></a></span>
                                    <span class="i-mid span-common"><a href="/u/5510462/course/177/codes">代码 <i>1</i></a></span>
                                    <span class="i-right span-common"><a href="/u/5510462/course/177/questions">问答 <i>0</i></a></span>
    
                                    
                                </div>
                            </div>
                            
                            
                        </li>
                                            <li class="course-one" data-courseid="799" data-uid="5510462">
                            <div class="course-list-img l">
                                <a href="/learn/799" target="_blank">
                                    <img width="200" height="113" alt="RBAC打造通用web管理权限" src="//img.mukewang.com/5885a1f5000113a506000338-240-135.jpg" />
                                </a>
                            </div>
                            <div class="course-list-cont">
                                <h3 class="study-hd">
                                    <a href="/learn/799" target="_blank">RBAC打造通用web管理权限</a>
    
                                                                                                                  <span class="i-new">更新至5-1</span>
                                                                                                        <!-- 收藏和删除 -->
                                                                </h3>
                                                            <div class="study-points">
                                    <span class="i-left span-common">已学12%</span>
                                    <span class="i-mid span-common">用时 5分</span>
                                    <span class="i-right span-common">学习至2-1 常见的权限模型</span>
                                </div>
                                                            <div class="catog-points">
                                    <span class="i-left span-common"><a href="/u/5510462/notepad/799">笔记 <i>0</i></a></span>
                                    <span class="i-mid span-common"><a href="/u/5510462/course/799/codes">代码 <i>0</i></a></span>
                                    <span class="i-right span-common"><a href="/u/5510462/course/799/questions">问答 <i>0</i></a></span>
    
                                    
                                </div>
                            </div>
                            
                            
                        </li>
                                            <li class="course-one" data-courseid="898" data-uid="5510462">
                            <div class="course-list-img l">
                                <a href="/learn/898" target="_blank">
                                    <img width="200" height="113" alt="PHP中的会话控制" src="//img.mukewang.com/59c3917900011b8106000338-240-135.jpg" />
                                </a>
                            </div>
                            <div class="course-list-cont">
                                <h3 class="study-hd">
                                    <a href="/learn/898" target="_blank">PHP中的会话控制</a>
    
                                                                                                                  <span class="i-new">更新至3-5</span>
                                                                                                        <!-- 收藏和删除 -->
                                                                </h3>
                                                            <div class="study-points">
                                    <span class="i-left span-common">已学95%</span>
                                    <span class="i-mid span-common">用时12小时 9分</span>
                                    <span class="i-right span-common">学习至3-5 自定义会话管理器</span>
                                </div>
                                                            <div class="catog-points">
                                    <span class="i-left span-common"><a href="/u/5510462/notepad/898">笔记 <i>0</i></a></span>
                                    <span class="i-mid span-common"><a href="/u/5510462/course/898/codes">代码 <i>0</i></a></span>
                                    <span class="i-right span-common"><a href="/u/5510462/course/898/questions">问答 <i>0</i></a></span>
    
                                    
                                </div>
                            </div>
                            
                            
                        </li>
                                        </ul>
                </div>
            </div>
    
                    <div class="clearfix tl-item ">
                            <span class="time">
                    <b>2018</b>
                    <em>08月16日</em>
                </span>
                <div class="course-list course-list-m">
                    <ul class="clearfix">
                                            <li class="course-one" data-courseid="887" data-uid="5510462">
                            <div class="course-list-img l">
                                <a href="/learn/887" target="_blank">
                                    <img width="200" height="113" alt="PHP-面向对象" src="//img.mukewang.com/59acb1650001adce06000338-240-135.jpg" />
                                </a>
                            </div>
                            <div class="course-list-cont">
                                <h3 class="study-hd">
                                    <a href="/learn/887" target="_blank">PHP-面向对象</a>
    
                                                                                                                  <span class="i-new">更新至2-9</span>
                                                                                                        <!-- 收藏和删除 -->
                                                                </h3>
                                                            <div class="study-points">
                                    <span class="i-left span-common">已学82%</span>
                                    <span class="i-mid span-common">用时 2小时27分</span>
                                    <span class="i-right span-common">学习至2-9 接口类和抽象类以及设计模式</span>
                                </div>
                                                            <div class="catog-points">
                                    <span class="i-left span-common"><a href="/u/5510462/notepad/887">笔记 <i>0</i></a></span>
                                    <span class="i-mid span-common"><a href="/u/5510462/course/887/codes">代码 <i>0</i></a></span>
                                    <span class="i-right span-common"><a href="/u/5510462/course/887/questions">问答 <i>0</i></a></span>
    
                                    
                                </div>
                            </div>
                            
                            
                        </li>
                                        </ul>
                </div>
            </div>
    
                    <div class="clearfix tl-item ">
                            <span class="time">
                    <b>2018</b>
                    <em>08月15日</em>
                </span>
                <div class="course-list course-list-m">
                    <ul class="clearfix">
                                            <li class="course-one" data-courseid="184" data-uid="5510462">
                            <div class="course-list-img l">
                                <a href="/learn/184" target="_blank">
                                    <img width="200" height="113" alt="PHP面向对象编程" src="//img.mukewang.com/572b067f00019abf06000338-240-135.jpg" />
                                </a>
                            </div>
                            <div class="course-list-cont">
                                <h3 class="study-hd">
                                    <a href="/learn/184" target="_blank">PHP面向对象编程</a>
    
                                                                                                                <span class="i-new">更新完毕</span>
                                        <!-- 更新完毕 -->
                                                                                                        <!-- 收藏和删除 -->
                                                                </h3>
                                                            <div class="study-points">
                                    <span class="i-left span-common">已学100%</span>
                                    <span class="i-mid span-common">用时 9小时57分</span>
                                    <span class="i-right span-common">学习至6-1 课程总结</span>
                                </div>
                                                            <div class="catog-points">
                                    <span class="i-left span-common"><a href="/u/5510462/notepad/184">笔记 <i>0</i></a></span>
                                    <span class="i-mid span-common"><a href="/u/5510462/course/184/codes">代码 <i>0</i></a></span>
                                    <span class="i-right span-common"><a href="/u/5510462/course/184/questions">问答 <i>0</i></a></span>
    
                                    
                                </div>
                            </div>
                            
                            
                        </li>
                                        </ul>
                </div>
            </div>
    
                    <div class="clearfix tl-item ">
                            <span class="time">
                    <b>2018</b>
                    <em>08月08日</em>
                </span>
                <div class="course-list course-list-m">
                    <ul class="clearfix">
                                            <li class="course-one" data-courseid="1017" data-uid="5510462">
                            <div class="course-list-img l">
                                <a href="/learn/1017" target="_blank">
                                    <img width="200" height="113" alt="Python最火爬虫框架Scrapy入门与实践" src="//img.mukewang.com/5b5188020001677306000338-240-135.jpg" />
                                </a>
                            </div>
                            <div class="course-list-cont">
                                <h3 class="study-hd">
                                    <a href="/learn/1017" target="_blank">Python最火爬虫框架Scrapy入门与实践</a>
    
                                                                                                                <span class="i-new">更新完毕</span>
                                        <!-- 更新完毕 -->
                                                                                                        <!-- 收藏和删除 -->
                                                                </h3>
                                                            <div class="study-points">
                                    <span class="i-left span-common">已学0%</span>
                                    <span class="i-mid span-common">用时 0分</span>
                                    <span class="i-right span-common">学习至2-8 保存数据</span>
                                </div>
                                                            <div class="catog-points">
                                    <span class="i-left span-common"><a href="/u/5510462/notepad/1017">笔记 <i>0</i></a></span>
                                    <span class="i-mid span-common"><a href="/u/5510462/course/1017/codes">代码 <i>0</i></a></span>
                                    <span class="i-right span-common"><a href="/u/5510462/course/1017/questions">问答 <i>0</i></a></span>
    
                                    
                                </div>
                            </div>
                            
                            
                        </li>
                                            <li class="course-one" data-courseid="458" data-uid="5510462">
                            <div class="course-list-img l">
                                <a href="/learn/458" target="_blank">
                                    <img width="200" height="113" alt="django初体验" src="//img.mukewang.com/5705d21e0001e4f106000338-240-135.jpg" />
                                </a>
                            </div>
                            <div class="course-list-cont">
                                <h3 class="study-hd">
                                    <a href="/learn/458" target="_blank">django初体验</a>
    
                                                                                                                <span class="i-new">更新完毕</span>
                                        <!-- 更新完毕 -->
                                                                                                        <!-- 收藏和删除 -->
                                                                </h3>
                                                            <div class="study-points">
                                    <span class="i-left span-common">已学0%</span>
                                    <span class="i-mid span-common">用时 0分</span>
                                    <span class="i-right span-common">学习至3-1 django初体检</span>
                                </div>
                                                            <div class="catog-points">
                                    <span class="i-left span-common"><a href="/u/5510462/notepad/458">笔记 <i>0</i></a></span>
                                    <span class="i-mid span-common"><a href="/u/5510462/course/458/codes">代码 <i>0</i></a></span>
                                    <span class="i-right span-common"><a href="/u/5510462/course/458/questions">问答 <i>0</i></a></span>
    
                                    
                                </div>
                            </div>
                            
                            
                        </li>
                                            <li class="course-one" data-courseid="317" data-uid="5510462">
                            <div class="course-list-img l">
                                <a href="/learn/317" target="_blank">
                                    <img width="200" height="113" alt="python进阶" src="//img.mukewang.com/5705b7350001d59b06000338-240-135.jpg" />
                                </a>
                            </div>
                            <div class="course-list-cont">
                                <h3 class="study-hd">
                                    <a href="/learn/317" target="_blank">python进阶</a>
    
                                                                                                                <span class="i-new">更新完毕</span>
                                        <!-- 更新完毕 -->
                                                                                                        <!-- 收藏和删除 -->
                                                                </h3>
                                                            <div class="study-points">
                                    <span class="i-left span-common">已学0%</span>
                                    <span class="i-mid span-common">用时10分</span>
                                    <span class="i-right span-common">学习至3-4 python之使用__future__</span>
                                </div>
                                                            <div class="catog-points">
                                    <span class="i-left span-common"><a href="/u/5510462/notepad/317">笔记 <i>0</i></a></span>
                                    <span class="i-mid span-common"><a href="/u/5510462/course/317/codes">代码 <i>0</i></a></span>
                                    <span class="i-right span-common"><a href="/u/5510462/course/317/questions">问答 <i>0</i></a></span>
    
                                    
                                </div>
                            </div>
                            
                            
                        </li>
                                            <li class="course-one" data-courseid="702" data-uid="5510462">
                            <div class="course-list-img l">
                                <a href="/learn/702" target="_blank">
                                    <img width="200" height="113" alt="轻松学会Laravel-高级篇" src="//img.mukewang.com/581bec530001202106000338-240-135.jpg" />
                                </a>
                            </div>
                            <div class="course-list-cont">
                                <h3 class="study-hd">
                                    <a href="/learn/702" target="_blank">轻松学会Laravel-高级篇</a>
    
                                                                                                                <span class="i-new">更新完毕</span>
                                        <!-- 更新完毕 -->
                                                                                                        <!-- 收藏和删除 -->
                                                                </h3>
                                                            <div class="study-points">
                                    <span class="i-left span-common">已学0%</span>
                                    <span class="i-mid span-common">用时 1分</span>
                                    <span class="i-right span-common">学习至5-1 Laravel中的文件上传</span>
                                </div>
                                                            <div class="catog-points">
                                    <span class="i-left span-common"><a href="/u/5510462/notepad/702">笔记 <i>0</i></a></span>
                                    <span class="i-mid span-common"><a href="/u/5510462/course/702/codes">代码 <i>0</i></a></span>
                                    <span class="i-right span-common"><a href="/u/5510462/course/702/questions">问答 <i>0</i></a></span>
    
                                    
                                </div>
                            </div>
                            
                            
                        </li>
                                        </ul>
                </div>
            </div>
    
                    <div class="clearfix tl-item ">
                            <span class="time">
                    <b>2018</b>
                    <em>08月07日</em>
                </span>
                <div class="course-list course-list-m">
                    <ul class="clearfix">
                                            <li class="course-one" data-courseid="596" data-uid="5510462">
                            <div class="course-list-img l">
                                <a href="/learn/596" target="_blank">
                                    <img width="200" height="113" alt=" PHP第三方登录—QQ登录" src="//img.mukewang.com/56a0932200014c4d06000338-240-135.jpg" />
                                </a>
                            </div>
                            <div class="course-list-cont">
                                <h3 class="study-hd">
                                    <a href="/learn/596" target="_blank"> PHP第三方登录—QQ登录</a>
    
                                                                                                                <span class="i-new">更新完毕</span>
                                        <!-- 更新完毕 -->
                                                                                                        <!-- 收藏和删除 -->
                                                                </h3>
                                                            <div class="study-points">
                                    <span class="i-left span-common">已学87%</span>
                                    <span class="i-mid span-common">用时 3小时36分</span>
                                    <span class="i-right span-common">学习至5-2 课程总结</span>
                                </div>
                                                            <div class="catog-points">
                                    <span class="i-left span-common"><a href="/u/5510462/notepad/596">笔记 <i>0</i></a></span>
                                    <span class="i-mid span-common"><a href="/u/5510462/course/596/codes">代码 <i>0</i></a></span>
                                    <span class="i-right span-common"><a href="/u/5510462/course/596/questions">问答 <i>0</i></a></span>
    
                                    
                                </div>
                            </div>
                            
                            
                        </li>
                                        </ul>
                </div>
            </div>
    
                    <div class="clearfix tl-item ">
                            <span class="time">
                    <b>2018</b>
                    <em>08月01日</em>
                </span>
                <div class="course-list course-list-m">
                    <ul class="clearfix">
                                            <li class="course-one" data-courseid="623" data-uid="5510462">
                            <div class="course-list-img l">
                                <a href="/learn/623" target="_blank">
                                    <img width="200" height="113" alt="PHP第三方登录—微博登录" src="//img.mukewang.com/56e1321f0001550c06000338-240-135.jpg" />
                                </a>
                            </div>
                            <div class="course-list-cont">
                                <h3 class="study-hd">
                                    <a href="/learn/623" target="_blank">PHP第三方登录—微博登录</a>
    
                                                                                                                <span class="i-new">更新完毕</span>
                                        <!-- 更新完毕 -->
                                                                                                        <!-- 收藏和删除 -->
                                                                </h3>
                                                            <div class="study-points">
                                    <span class="i-left span-common">已学93%</span>
                                    <span class="i-mid span-common">用时11小时12分</span>
                                    <span class="i-right span-common">学习至4-1 注意事项与课程总结</span>
                                </div>
                                                            <div class="catog-points">
                                    <span class="i-left span-common"><a href="/u/5510462/notepad/623">笔记 <i>0</i></a></span>
                                    <span class="i-mid span-common"><a href="/u/5510462/course/623/codes">代码 <i>0</i></a></span>
                                    <span class="i-right span-common"><a href="/u/5510462/course/623/questions">问答 <i>0</i></a></span>
    
                                    
                                </div>
                            </div>
                            
                            
                        </li>
                                        </ul>
                </div>
            </div>
    
                    <div class="clearfix tl-item ">
                            <span class="time">
                    <b>2018</b>
                    <em>07月30日</em>
                </span>
                <div class="course-list course-list-m">
                    <ul class="clearfix">
                                            <li class="course-one" data-courseid="557" data-uid="5510462">
                            <div class="course-list-img l">
                                <a href="/learn/557" target="_blank">
                                    <img width="200" height="113" alt="PHP第三方登录—OAuth2.0协议" src="//img.mukewang.com/5668dc790001aa2b06000338-240-135.jpg" />
                                </a>
                            </div>
                            <div class="course-list-cont">
                                <h3 class="study-hd">
                                    <a href="/learn/557" target="_blank">PHP第三方登录—OAuth2.0协议</a>
    
                                                                                                                <span class="i-new">更新完毕</span>
                                        <!-- 更新完毕 -->
                                                                                                        <!-- 收藏和删除 -->
                                                                </h3>
                                                            <div class="study-points">
                                    <span class="i-left span-common">已学100%</span>
                                    <span class="i-mid span-common">用时50分</span>
                                    <span class="i-right span-common">学习至2-2 步骤一请求OAuth登录页</span>
                                </div>
                                                            <div class="catog-points">
                                    <span class="i-left span-common"><a href="/u/5510462/notepad/557">笔记 <i>1</i></a></span>
                                    <span class="i-mid span-common"><a href="/u/5510462/course/557/codes">代码 <i>0</i></a></span>
                                    <span class="i-right span-common"><a href="/u/5510462/course/557/questions">问答 <i>0</i></a></span>
    
                                    
                                </div>
                            </div>
                            
                            
                        </li>
                                        </ul>
                </div>
            </div>
    
                    <div class="clearfix tl-item ">
                            <span class="time">
                    <b>2018</b>
                    <em>07月15日</em>
                </span>
                <div class="course-list course-list-m">
                    <ul class="clearfix">
                                            <li class="course-one" data-courseid="416" data-uid="5510462">
                            <div class="course-list-img l">
                                <a href="/learn/416" target="_blank">
                                    <img width="200" height="113" alt="Python文件处理" src="//img.mukewang.com/5705b7940001096106000338-240-135.jpg" />
                                </a>
                            </div>
                            <div class="course-list-cont">
                                <h3 class="study-hd">
                                    <a href="/learn/416" target="_blank">Python文件处理</a>
    
                                                                                                                <span class="i-new">更新完毕</span>
                                        <!-- 更新完毕 -->
                                                                                                        <!-- 收藏和删除 -->
                                                                </h3>
                                                            <div class="study-points">
                                    <span class="i-left span-common">已学0%</span>
                                    <span class="i-mid span-common">用时 0分</span>
                                    <span class="i-right span-common">学习至4-1 文件练习</span>
                                </div>
                                                            <div class="catog-points">
                                    <span class="i-left span-common"><a href="/u/5510462/notepad/416">笔记 <i>0</i></a></span>
                                    <span class="i-mid span-common"><a href="/u/5510462/course/416/codes">代码 <i>0</i></a></span>
                                    <span class="i-right span-common"><a href="/u/5510462/course/416/questions">问答 <i>0</i></a></span>
    
                                    
                                </div>
                            </div>
                            
                            
                        </li>
                                        </ul>
                </div>
            </div>
    
                    <div class="clearfix tl-item ">
                            <span class="time">
                    <b>2018</b>
                    <em>04月20日</em>
                </span>
                <div class="course-list course-list-m">
                    <ul class="clearfix">
                                            <li class="course-one" data-courseid="703" data-uid="5510462">
                            <div class="course-list-img l">
                                <a href="/learn/703" target="_blank">
                                    <img width="200" height="113" alt="PHP环境LAMP/LNMP安装与配置" src="//img.mukewang.com/57eb9feb000106ec06000338-240-135.jpg" />
                                </a>
                            </div>
                            <div class="course-list-cont">
                                <h3 class="study-hd">
                                    <a href="/learn/703" target="_blank">PHP环境LAMP/LNMP安装与配置</a>
    
                                                                                                                <span class="i-new">更新完毕</span>
                                        <!-- 更新完毕 -->
                                                                                                        <!-- 收藏和删除 -->
                                                                </h3>
                                                            <div class="study-points">
                                    <span class="i-left span-common">已学89%</span>
                                    <span class="i-mid span-common">用时 2小时14分</span>
                                    <span class="i-right span-common">学习至9-1 LAMP/LNMP安装与配置课程总结</span>
                                </div>
                                                            <div class="catog-points">
                                    <span class="i-left span-common"><a href="/u/5510462/notepad/703">笔记 <i>0</i></a></span>
                                    <span class="i-mid span-common"><a href="/u/5510462/course/703/codes">代码 <i>0</i></a></span>
                                    <span class="i-right span-common"><a href="/u/5510462/course/703/questions">问答 <i>0</i></a></span>
    
                                    
                                </div>
                            </div>
                            
                            
                        </li>
                                        </ul>
                </div>
            </div>
    
                    <div class="clearfix tl-item  tl-item-last">
                            <span class="time">
                    <b>2018</b>
                    <em>04月18日</em>
                </span>
                <div class="course-list course-list-m">
                    <ul class="clearfix">
                                            <li class="course-one" data-courseid="697" data-uid="5510462">
                            <div class="course-list-img l">
                                <a href="/learn/697" target="_blank">
                                    <img width="200" height="113" alt="轻松学会Laravel-基础篇" src="//img.mukewang.com/57a2bd030001018806000338-240-135.jpg" />
                                </a>
                            </div>
                            <div class="course-list-cont">
                                <h3 class="study-hd">
                                    <a href="/learn/697" target="_blank">轻松学会Laravel-基础篇</a>
    
                                                                                                                  <span class="i-new">更新至8-1</span>
                                                                                                        <!-- 收藏和删除 -->
                                                                </h3>
                                                            <div class="study-points">
                                    <span class="i-left span-common">已学4%</span>
                                    <span class="i-mid span-common">用时 3分</span>
                                    <span class="i-right span-common">学习至1-2 Laravel的版本选择</span>
                                </div>
                                                            <div class="catog-points">
                                    <span class="i-left span-common"><a href="/u/5510462/notepad/697">笔记 <i>0</i></a></span>
                                    <span class="i-mid span-common"><a href="/u/5510462/course/697/codes">代码 <i>0</i></a></span>
                                    <span class="i-right span-common"><a href="/u/5510462/course/697/questions">问答 <i>0</i></a></span>
    
                                    
                                </div>
                            </div>
                            
                            
                        </li>
                                        </ul>
                </div>
            </div>
    
                </div>
        <!-- 分页 -->
        <div class="qa-comment-page">
                        <div class="page"><span class="disabled_page">首页</span><span class="disabled_page">上一页</span><a href="javascript:void(0)" class="active text-page-tag">1</a><a class="text-page-tag" href="/u/5510462/courses?page=2">2</a><a class="text-page-tag" href="/u/5510462/courses?page=3">3</a><a href="/u/5510462/courses?page=2">下一页</a><a href="/u/5510462/courses?page=3">尾页</a></div>
                </div>
    
        
    </div><!-- .container end -->
    </div><!-- .wrap end-->
    
    </div>
    
    <div id="footer" data="u,courses">
        <div class="waper">
            <div class="footerwaper clearfix">
                <div class="followus r">
                    <a class="followus-weixin" href="javascript:;"  target="_blank" title="微信">
                        <div class="flw-weixin-box"></div>
                    </a>
                    <a class="followus-weibo" href="http://weibo.com/u/3306361973"  target="_blank" title="新浪微博"></a>
                    <a class="followus-qzone" href="http://user.qzone.qq.com/1059809142/" target="_blank" title="QQ空间"></a>
                </div>
                <div class="footer_intro l">
                    <div class="footer_link">
                        <ul>
                            <li><a href="//www.imooc.com/" target="_blank">网站首页</a></li>
                            <li><a href="/index/companytrain" target="_blank" title="企业合作">企业合作</a></li>
                            <li><a href="/about/job" target="_blank">人才招聘</a></li>
                            <li> <a href="/about/contact" target="_blank">联系我们</a></li>
                            <li> <a href="/about/recruit" target="_blank">讲师招募</a></li>
                            <li> <a href="/help" target="_blank">帮助中心</a></li>
                            <li> <a href="/user/feedback" target="_blank">意见反馈</a></li>
                            <li><a href="http://daxue.imooc.com/" target="_blank">慕课大学</a></li>
                            <li> <a href="/about/friendly" target="_blank">友情链接</a></li>
                           <!--  <li><a href="/corp/index" target="_blank">合作专区</a></li>
                            <li><a href="/about/us" target="_blank">关于我们</a></li> -->
                        </ul>
                    </div>
                    <p>Copyright © 2018 imooc.com All Rights Reserved | 京ICP备 12003892号-11 </p>
                </div>
            </div>
        </div>
    </div>
    
    
    <div id="J_GotoTop" class="elevator">
    
        <a href="/user/feedback" class="elevator-msg" target="_blank">
            <i class="icon-feedback"></i>
            <span class="">意见反馈</span>
        </a>
        <a href="/help" class="elevator-faq" target="_blank">
            <i class="icon-ques"></i>
            <span class="">帮助中心</span>
        </a>
        <a href="//www.imooc.com/mobile/app" target="_blank" class="elevator-app" >
            <i class="icon-appdownload"></i>
            <span class="">APP下载</span>
            <div class="elevator-app-box"></div>
        </a>
        <a href="javascript:void(0)" class="elevator-weixin no-goto" id="js-elevator-weixin" >
            <i class="icon-wxgzh"></i>
            <span class="">官方微信</span>
            <div class="elevator-weixin-box"></div>
        </a>
        <a href="javascript:void(0)" class="elevator-top no-goto" style="display:none" id="backTop">
            <i class="icon-up2"></i>
            <span class="">返回顶部</span>
        </a>
    </div>
    
    
    
    <!--script-->
    <script type="text/javascript" src="//moco.imooc.com/static/monitor/error.js"></script>
    <script src="/passport/static/scripts/ssologin.js?v=2.0"></script>
    <script type="text/javascript" src="/static/sea-modules/seajs/seajs/2.1.1/sea.js"></script>
    <script type="text/javascript" src="/static/sea_config.js?v=201810221819"></script>
    <script type="text/javascript">seajs.use("/static/page/"+OP_CONFIG.module+"/"+OP_CONFIG.page);</script>
    
    
    
    
    <style type="text/css">.myClassList table td dl dd { margin-top:88px } #face_panel { z-index:99999999 }</style>
    
    <div id="layer_sendmsg" class="font-colorg" style="display:none">
    
    </div>
    
    
    
    
    <div style="display: none">
    <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?f0cfcccd7b1393990c78efdeebff3968";
      var s = document.getElementsByTagName("script")[0]; 
      s.parentNode.insertBefore(hm, s);
    })();
    (function (d) {
    window.bd_cpro_rtid="rHT4P1c";
    var s = d.createElement("script");s.type = "text/javascript";s.async = true;s.src = location.protocol + "//cpro.baidu.com/cpro/ui/rt.js";
    var s0 = d.getElementsByTagName("script")[0];s0.parentNode.insertBefore(s, s0);
    })(document);
    </script>
    <script>
    (function(){
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
        }else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
    </script>
    </div>
    </body>
    </html>

     ==================================curl从ftp下载文件=============================================

    <?php
    $obj=curl_init();
    
    curl_setopt($obj,CURLOPT_URL,"ftp://dele.gotoftp3.com/wwwroot/404.php");
    curl_setopt($obj,CURLOPT_HEADER,0);
    curl_setopt($obj,CURLOPT_RETURNTRANSFER,1);
    curl_setopt($obj,CURLOPT_TIMEOUT,300);//
    curl_setopt($obj,CURLOPT_USERPWD,"dee:r9uj");//账号密码
    
    $outfile=fopen('download.php','wb');//保存到本地文件
    curl_setopt($obj,CURLOPT_FILE,$outfile);
    
    
    $opt=curl_exec($obj);
    fclose($outfile);
    if (!curl_errno($obj)){
        echo 'return:'.$opt;
    }else{
        echo 'curl error:'.curl_error($obj);
    
    }
    curl_close($obj);

     ===================================curl 往ftp上传文件===============================================

    <?php
    $obj=curl_init();
    $fp=fopen('baidu.php','r');//文件句柄
    
    curl_setopt($obj,CURLOPT_URL,"ftp://de.gotoftp3.com/wwwroot/baidu.txt");
    curl_setopt($obj,CURLOPT_HEADER,0);
    curl_setopt($obj,CURLOPT_RETURNTRANSFER,1);
    curl_setopt($obj,CURLOPT_TIMEOUT,300);
    curl_setopt($obj,CURLOPT_USERPWD,"dele:r9xdguj");
    
    //对文件设置 操作,上传的文件,文件的大小
    curl_setopt($obj,CURLOPT_UPLOAD,1);
    curl_setopt($obj,CURLOPT_INFILE,$fp);
    curl_setopt($obj,CURLOPT_INFILESIZE,filesize('baidu.php'));
    
    $opt=curl_exec($obj);
    fclose($fp);
    if (!curl_errno($obj)){
        echo 'success upload';
    }else{
        echo 'curl error:'.curl_error($obj);
    }
    curl_close($obj);

     ==============================curl 下载https中的数据==============================================

    <?php
    $obj=curl_init();
    date_default_timezone_set('PRC');
    
    curl_setopt($obj,CURLOPT_URL,"https://moco.imooc.com/captcha/script/captcha.min.js?v=1.0");
    curl_setopt($obj,CURLOPT_RETURNTRANSFER,1);
    
    curl_setopt($obj,CURLOPT_SSL_VERIFYPEER,0);
    $opt=curl_exec($obj);
    echo $opt;
    curl_close($obj);
  • 相关阅读:
    python基础三大器之装饰器
    python基础之推导式及匿名函数和高阶函数
    python基础之三大器中迭代器和生成器
    python基础之函数(动态参数,注释,名称空间,第一类对象及使用和函数嵌套)
    python基础之初识函数
    python基础之文件操作
    python基础之集合及基础补充(循坏删除,二次编码)
    Python基础之小数据池及深浅拷贝
    python基础之字典
    数据结构-栈
  • 原文地址:https://www.cnblogs.com/lxwphp/p/15453858.html
Copyright © 2020-2023  润新知