随笔分类 -  PHP

摘要:一、代码 public function export($month) { $year = date("Y", time()); //要导出的数据 $data =array(); $day_number = date("t", strtotime($year."-".$month)); vendor 阅读全文
posted @ 2021-09-27 09:32 样子2018 阅读(260) 评论(0) 推荐(0)
摘要:一、简单代码 $fileImage = 'https://域名/202109/11/134923278422.png'; $imgPathInfo =pathinfo($fileImage); $basename = $imgPathInfo['filename'].'png'; $filename 阅读全文
posted @ 2021-09-13 09:11 样子2018 阅读(632) 评论(0) 推荐(0)
摘要:一、函数封装 //阿里云短信插件 dtmoban.com function ali_sms($mobile,$id,$data){ //引入短信类 include DT_ROOT.'/api/aliyun/sendsms.class.php'; $params = array (); $access 阅读全文
posted @ 2021-07-30 15:36 样子2018 阅读(194) 评论(0) 推荐(0)
摘要:一、代码示例 前端test.html <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, user-scalable=no, 阅读全文
posted @ 2021-07-05 10:09 样子2018 阅读(225) 评论(0) 推荐(0)
摘要:一、示例 include './plugin/PHPExcel/PHPExcel.php'; include './plugin/PHPExcel/PHPExcel/IOFactory.php'; include './plugin/PHPExcel/PHPExcel/Reader/Excel5.p 阅读全文
posted @ 2021-05-07 09:07 样子2018 阅读(715) 评论(0) 推荐(0)
摘要:一、效果图 二、示例代码 class GoogleTranslate { const GOOGLE_URL = 'https://translate.google.cn/translate_a/'; public function shr32($x, $bits) { if ($bits <= 0) 阅读全文
posted @ 2021-04-05 10:35 样子2018 阅读(340) 评论(0) 推荐(0)
摘要:一、效果图 二、代码 1、客户端 <?php class SocketIO { public function send($host = null, $port = null, $action = "message", $data = null, $address = "/socket.io/?EI 阅读全文
posted @ 2021-01-27 13:38 样子2018 阅读(815) 评论(0) 推荐(0)
摘要:一、性能与底层 php7 最显著的变化就是性能的极大提升,PHP7速度是 PHP5.6 的两倍,PHP7在语言上也有一些变化,比如添加返回类型声明、增加了一些新的保留关键字等。在安全方面,去除了PHP安全模式,添加魔术引号等。 二、新特性 1、类型声明 现在php的标量有两种模式: 强制 (默认) 阅读全文
posted @ 2021-01-07 13:36 样子2018 阅读(446) 评论(0) 推荐(0)
摘要:一、代码 include_once 'common.php'; extract($_REQUEST); include './plugin/PHPExcel/PHPExcel.php'; include './plugin/PHPExcel/PHPExcel/IOFactory.php'; incl 阅读全文
posted @ 2020-12-14 13:07 样子2018 阅读(420) 评论(0) 推荐(0)
摘要:/* *@通过curl方式获取指定的图片到本地 *@ 完整的图片地址 *@ 要存储的文件名 */ function getImg($url = "", $filename = ""){ //去除URL连接上面可能的引号 $hander = curl_init(); $fp = fopen($file 阅读全文
posted @ 2020-09-22 16:27 样子2018 阅读(787) 评论(0) 推荐(0)
摘要:一、代码 class ZipFolder { private $zip = null; private $root_path = null; public function __construct() { $this->zip = new ZipArchive(); } /** * 开始压缩文件 * 阅读全文
posted @ 2020-08-15 15:23 样子2018 阅读(356) 评论(0) 推荐(0)
摘要:一、效果图 二、编码 /** * 图片base64编码 * @param string $img * @param bool $imgHtmlCode * @return string */ function imgBase64Encode($img = '', $imgHtmlCode = tru 阅读全文
posted @ 2020-05-07 16:38 样子2018 阅读(394) 评论(0) 推荐(0)
摘要:该简易博客采用CI框架+bootstrap+redis等技术混合架构开发。 更新 2019-01-16 新增关注 源码地址:联系我(QQ:2575404985)捐赠获取 一、效果图 阅读全文
posted @ 2020-01-16 10:16 样子2018 阅读(209) 评论(0) 推荐(0)
摘要:官网:http://www.geetest.com/first_page 一、效果图 二、代码 1、前端 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>极验</title> </head> <body> < 阅读全文
posted @ 2019-12-28 16:23 样子2018 阅读(515) 评论(0) 推荐(0)
摘要:html5开发的仿微信网页版聊天,采用html5+css3+jquery+websocket+amazeui等技术混合架构开发,实现了微信网页版的主要功能。 更新 2019-01-07 新增发送图片与文件、下载功能 2019-01-05 新增群聊 源码地址:https://github.com/ya 阅读全文
posted @ 2019-12-23 13:36 样子2018 阅读(998) 评论(0) 推荐(0)
摘要:1、htmlentities()函数转义html 2、html_entity_decode()函数反转义html 我这里是用来反转义富文本编辑器的内容 阅读全文
posted @ 2019-12-23 11:20 样子2018 阅读(2100) 评论(0) 推荐(0)
摘要:/** * 循环创建文件夹 * @param string $dir 需要创建的文件夹路径 * @param integer $mode 文件夹权限 * @return bool 返回创建是否成功 */ function loopMakeDir($dir, $mode = 0777) { if (i 阅读全文
posted @ 2019-12-20 16:48 样子2018 阅读(561) 评论(0) 推荐(0)
摘要:一、函数代码 /** * @param $lng1 * @param $lat1 * @param $lng2 * @param $lat2 * @return float */ function gl_GetDistance($lng1, $lat1, $lng2, $lat2) { $radLa 阅读全文
posted @ 2019-12-13 08:49 样子2018 阅读(756) 评论(0) 推荐(0)
摘要:测试文件代码如下: 去除注释代码如下: 结果代码如下: 注意:代码中有//的,都会去除 阅读全文
posted @ 2019-10-22 14:01 样子2018 阅读(1588) 评论(2) 推荐(0)
摘要:方式一: 方式一改进版: 批量加密解密没有做 方式二: doEncode.php 参考网址:https://github.com/uniqid/encipher 阅读全文
posted @ 2019-10-16 13:20 样子2018 阅读(6625) 评论(1) 推荐(0)