随笔分类 - PHP Code
PHP Code
摘要:<?php namespace app\controller; header('Content-type:text/html;charset=utf8'); use app\BaseController; use think\App; use think\facade\Db; /** * 测试php
阅读全文
摘要:sodium_crypto_aead_aes256gcm_decrypt 无法使用需要安装 sodium 其实在 >=php7.2 以上的版本都自带了 这个模块 不用重新安装只需 将 extension=sodium.so 前的 ;分号去掉保存 就可以了 如果您使用的是 windows phpstu
阅读全文
摘要:例如: <?php $a = array( "latitude" => 31.219319, "longitude" => 121.416821 ); echo json_encode($a); // 然而却输出来了 {"latitude":31.219318999999999,"longitude
阅读全文
摘要:/** * Notes:导入excel文件 * User: hly * Date: 2020/4/14 17:56 */ function importXlsx() { //引入phpexcel require getcwd() . '/PHPExcel.php'; $file_name = 'te
阅读全文
摘要:/** * 在已有excel表中插入数据例子 */ public function readyExcel($filename){ vendor("PHPExcel.PHPExcel"); $inputFileName = $filename;//excel文件路径 date_default_time
阅读全文
摘要:(本来很小的需求 网上几乎没有给出直接的答案 希望帮助到更多的人 笑哭~) 1 <?php 2 $request = '00000000106.0f3 '; 3 //$request = '00000000106.03 '; 4 $temp = trim($request); 5 $value =
阅读全文
摘要:如下图: 1 <?php 2 3 /** 4 * 栏目记录树 5 * Author 撑一支船蒿 hly 6 * 364077286@qq.com 7 */ 8 class tree 9 { 10 /** 11 * Notes: 递归拿到每个一级栏目的 的子数组 12 * User: hly 13 *
阅读全文
摘要:<?php $clean_text = ""; // Match Emoticons $regexEmoticons = '/[\x{1F600}-\x{1F64F}]/u'; $clean_text = preg_replace($regexEmoticons, '', $str); // Mat
阅读全文
摘要:1 <?php 2 3 /** 4 * blog:http://www.zhaokeli.com 5 * 处理四角圆图片 6 * @param string $imgpath 源图片路径 7 * @param integer $radius 圆角半径长度默认为15,处理成圆型 8 * @return
阅读全文
摘要:1 /*** 2 * 微信客服发送信息 3 * 微信客服信息推送失败 微信重复推送客服消息 40001 45047 4 * 递归提交到微信 直到提交成功 5 * @param $openid 6 * @param int $is_repeat 是否递归 7 * @return bool 8 */ 9
阅读全文
摘要:1 <?php 2 /** 3 * 处理成圆图片,如果图片不是正方形就取最小边的圆半径,从左边开始剪切成圆形 4 * @param string $imgpath [description] 5 * @return [type] [description] 6 */ 7 function yuan_
阅读全文
摘要:1 <?php 2 ini_set('display_errors', 'on'); 3 4 class chatClass { 5 private $redis; 6 7 //这个变量模拟用户当前状态,是否登录,是否可查看 8 public $checkUserReadable = false;
阅读全文
摘要:php xml转数组 自定义xml_to_array 欢迎沟通交流
阅读全文
摘要:bk_jskc xxxx@163.com#.cn '; $url = 'http://*.*.*.*:8867/Service.asmx?op=execProc_string'; //接收xml数据的文件 $header[] = "Content-t...
阅读全文
摘要:1 array( 7 'method' => 'POST', 8 'header' => 'Content-type:application/x-www-form-urlencoded', 9 'content' => $postdata, 10 'timeout' => 15 * 60 /...
阅读全文
摘要:1 $minLat, 27 'maxLat' => $maxLat, 28 'minLng' => $minLng, 29 'maxLng' => $maxLng 30 ); 31 return $scope; 32 } 33 34 //范围距离内判断 posx 经度字段 posy 维度字段 35 //$_POST['r...
阅读全文
摘要:php 遍历一个文件夹下的所有文件和子文件 1 <?php 2 /** 3 * 将读取到的目录以数组的形式展现出来 4 * @return array 5 * opendir() 函数打开一个目录句柄,可由 closedir(),readdir() 和 rewinddir() 使用。 6 * is_
阅读全文

浙公网安备 33010602011771号