php教程

  • 百度编辑器上传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...

  • PHP操作TXT写入读取清空方法

    PHP写入TXT<?php$hua = "这是我要写入的一段话";$filename = &#39;name.txt&#39;;$handle =fopen($filename,&#39;a&#39;); fwrite($handle,$hua); fclose($handele);?>PHP读取TXT内容-----第一种方法-----fopen+fread--------<?php$file_path = "te...

    782年前
  • PHP写入TXT文本方法

    <?$url = $_GET[&#39;url&#39;];$file = "url.txt";$handle =fopen($file,&#39;a&#39;); fwrite($handle,""); fwrite($handle,"URL:");fwrite($handle,"$url"); fclose($handele);header("location: $url&q...

    532年前
  • ICP备案信息查询API接口

    api接口代码<?phpheader("Access-Control-Allow-Origin:*");header("Access-Control-Allow-Methods:GET");header("Access-Control-Allow-Headers:x-requested-with,content-type");header("Content-Type:text/html,application/json; char...

  • PHP截取字符前后面的字符串

    截取字符后面的内容 strripos函数获取&字符串后面的内容$number = &#39;1111&0123456&#39;;$result = substr($number,strripos($number,"&")+1);echo $result;输出0123456截取字符前面的内容strripos函数获取&字符串前面的内容$test = &#39;1111&0...

    562年前
  • PHP过滤HTML标签代码方法

    过滤指定标签大全$str=preg_replace("/\s+/", " ", $str); //过滤多余回车$str=preg_replace("/<[ ]+/si","<",$str); //过滤<__("<"号后面带空格)$str=preg_replace("/<\!--.*?-->/si","",$str); //注释$...

  • PHP指定范围内且不重复的随机值方法

    代码案列生成10个1到100范围内的不重复随机数<?php/** array unique_rand( int $min, int $max, int $num )* 生成一定数量的不重复随机数,指定的范围内整数的数量必须* 比要生成的随机数数量大* $min 和 $max: 指定随机数的范围* $num: 指定生成数量...

  • PHP图片上写字方法

    实现效果:在一张图片上写指定文字,然后在生成一张带有文字的新图片。<?php/** * PHP实现文字写入图片 */class wordsOnImg { public $config = null; /** * @param $config 传入参数 * @param $config[&#39;file&#39;] 图片文件 * @param ...

    892年前
«上一页第(15/29)页下一页»