zoukankan      html  css  js  c++  java
  • 百度生成短网址

    测试短网址:http://dwz.cn/

    生成短网址

    $ch=curl_init();
    curl_setopt($ch,CURLOPT_URL,"http://dwz.cn/create.php");
    curl_setopt($ch,CURLOPT_POST,true);
    curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
    $data=array('url'=>'http://www.baidu.com/');
    curl_setopt($ch,CURLOPT_POSTFIELDS,$data);
    $strRes=curl_exec($ch);
    curl_close($ch);
    $arrResponse=json_decode($strRes,true);
    if($arrResponse['status']==0)
    {
    /**错误处理*/
    echo iconv('UTF-8','GBK',$arrResponse['err_msg'])." ";
    }
    /** tinyurl */
    echo$arrResponse['tinyurl']." ";
    ?>
    其他接口使用如上

    原文链接:http://www.baidu.com/search/dwz.html#05

  • 相关阅读:
    Hibernate初学
    表分区
    单列函数
    Oracle基础
    8.28
    SpringMVC
    SpringMVC 初级操作
    试题评测
    Mybatis

  • 原文地址:https://www.cnblogs.com/isboy/p/4224163.html
Copyright © 2011-2022 走看看