php教程

  • php判断目录文件是否存在

    一段简单的php判断目录文件是否存在代码,收藏记录一下,以后肯定用得到的。<?php$filename = &#39;../../e/install/&#39;; if (file_exists($filename)) { echo "<h3><div align=&#39;center&#39;><font color=&#39;#FF0000&#39;>存在安全风险!请将 ...

  • json参数的传递和接收处理方法

    php传递json参数示例<? function http_post_data($url, $data_string) { $ch = curl_init(); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); ...

    2年前
  • curl函数获取API接口数据方法

    PHP利用curl函数,获取API接口数据方法示例代码,自用收藏<?php $weather = curl_init(); curl_setopt($weather,CURLOPT_URL,"https://api.pc2801.com/cqssc/".time()); curl_setopt($weather, CURLOPT_SSL_VERIFYPEER, false); //如果...

  • 158网盘直连解析代码

    API代码<?php/*** @package 158Pan* @author Andy* @version 1.2.0* @link https://lsland.cn*/// 指定允许其他域名访问 header(&#39;Access-Control-Allow-Origin:*&#39;);header(&#39;content-type:application/json;charset:utf-8&#39;);functi...

  • PHP显示昨天今天后天时间日期方法

    首先一天的时间戳用PHP写就是:<?=date(&#39;Y-m-d H:i:s&#39;,($bqr[newstime]+86400))?>昨天今天后天时间的方法为:<?phpecho "今天:".date("Y-m-d")."<br>"; echo "昨天:".date("Y-m-d",strtotime("-1 day")),...

    2年前
  • PHP获取QQ用户昵称+头像API接口代码

    如果要获得QQ用户的头像和昵称,需要在腾讯开放平台申请API接入才可以,但是这个不需要!只需要输入用户的正确的QQ号即可返回用户的头像和昵称。API接口代码<?php // 通过QQ号即可获取用户信息 // 获取QQ头像接口// http://q1.qlogo.cn/g?b=qq&nk=QQ号&s=...

  • php破解图床防盗链方法

    PHP代码命名为dl.php<?phpclass ImgBridge{private $water=&#39;&#39;;private $imgUrl=&#39;&#39;;private $referer=&#39;&#39;;private $ua=&#39;MQQBrowser/26 Mozilla/5.0 (Linux; U; Android 2.3.7; zh-cn; MB200 Build/GRJ22; CyanogenMod-7...

  • 百度编辑器上传word转html

    后台上传word转html到编辑器中,编辑器是使用的百度编辑器,先在页面合适的位置写个上传框<button type=”button” name=”fileword” id=”upload-fileword”>上传word文件</button>前端用的layui框架,不需要写提示框,图个方便,大家自行选择<script>layui...

  • php联通查话费API接口源码

    API接口源码<?php$url="https://weixin.10010js.com/app/charge/qryRealFee";$data=&#39;{"phone":&#39;.&#39;"&#39;.$_GET["phone"].&#39;"}&#39;;echo "您的帐户余额是:<font color=red size=30>&quot...

  • PHP生成sitemap网站地图代码

    网站地图生成代码<?php$dom = new DOMDocument("1.0", "utf-8");header("Content-Type: text/xml");$root = $dom->createElement("urlset");$dom->appendChild($root);for ($i = 0; $i <= 998; $i++) {$track = $dom->create...

«上一页第(14/29)页下一页»