php
文章平均质量分 67
柳逸尘Lycodx
苟活
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
华为云鲲鹏服务器安装PHP-FPM
华为鲲鹏安装php-fpm原创 2022-04-12 23:17:08 · 628 阅读 · 0 评论 -
laravel学习笔记
请求 验证请求方式 request()->isMethod('post'); 获取请求所有请求 request()->input(); 验证 use Validator; //laravel验证不会终止,bail防止穿透,第一个验证不正确就结束 $rule = [ 'user_name' => 'bail|required', 'password' =>...原创 2021-03-21 17:51:13 · 408 阅读 · 1 评论 -
interface、abstract及trait的基本使用
interface接口:一种成员属性为抽象的特殊抽象类,在程序中同为规范的作用。原创 2021-03-21 11:48:54 · 525 阅读 · 3 评论 -
2020年终小结
文章目录1凄凄切切群1.2 发送到发送到 1凄凄切切群 1.2 发送到发送到原创 2021-03-17 16:40:38 · 296 阅读 · 0 评论 -
PHP解决\ufeff问题
写项目是请求接口发现返回的json数据无法用json_decode进行转换。 查看Network发现返回值前面有个小红点(\ufeff) 众所周知文件编码是含BOM的会导致出现这种情况,但是我查看了所有文件都是不含BOM的,这种情况下,就要用代码处理 ob_clean(); 将这个放在要返回的前面就行了 ...原创 2020-05-23 10:27:27 · 1710 阅读 · 0 评论 -
mysql存入和读取emoji表情
/** * Emoji原形转换为String * @param string $content * @return string */ function emojiEncode($content) { return json_decode(preg_replace_callback("/(\\\u[ed][0-9a-f]{3})/i", function($str) { return addslashes($str[0]); }, json_encode($content))); .原创 2020-05-16 14:32:46 · 565 阅读 · 0 评论 -
TP5.1运行php think make:middleware Check 报错
错误信息 PHP Fatal error: Cannot use Workerman\Worker as Worker because the name is already in use in D:\2020study\think\vendor\topthink\think-worker\src\command\Server.php on line 22 PHP Stack trace: PH...原创 2020-03-11 11:00:58 · 1974 阅读 · 0 评论 -
PhpSpreadsheet导出和读取Excel的简单使用
下载和安装 ① github下载:https://github.com/PHPOffice/PhpSpreadsheet ② composer安装: composer require phpoffice/phpspreadsheet composer安装时注意php版本,php要开启fileinfo扩展。 我这里使用的tp5.1 Excel导出 <?php use think\Contr...原创 2020-03-03 14:59:02 · 1728 阅读 · 0 评论 -
使用phpqrcode生成二维码
一、准备工作 1.phpqrcode类文件下载:https://sourceforge.net/projects/phpqrcode/ 2.下载下来的有一大堆文件,我们只取其中的一个phpqrcode.php就行。 3.将文件phpqrcode.php放在extend文件夹里 4.php开启gd2扩展 二、直接上代码 <?php use think\Controller; require...原创 2020-03-02 15:46:36 · 324 阅读 · 0 评论 -
基于thinkPHP使用PHPMailer发送邮件
一、phpmailer 安装或者下载方式 1、从 github 上下载: https://github.com/PHPMailer/PHPMailer/ 2、使用 composer 安装(推荐使用): composer require phpmailer/phpmailer 二、目录结构 主要是PHPMailer.php和SMTP.php两个文件 三、php设置 一般主流邮箱 SMTP 服务器...原创 2020-03-01 18:26:57 · 1667 阅读 · 1 评论 -
GatewayWorker实现指定用户之间聊天
首先去官网下载:https://www.workerman.net/download 1.文件结构: ps:index.php是我创建的主要用于本次项目的讲解,后缀也可以用html。 2.找到start_gateway.php文件,改成Websocket $gateway = new Gateway("Websocket://0.0.0.0:8282"); 3.index.php <!D...原创 2020-02-29 17:40:39 · 1363 阅读 · 0 评论 -
php之gd2
一、使用gd2之前首先要开启gd2扩展 找到php的配置文件php.ini,搜索extension=php_gd2.dll,去掉前面的分号即可; 函数介绍 由于gd2的函数比较的长,所有对部分函数进行介绍 1.imagecreatetruecolor — 新建一个真彩色图像 imagecreatetruecolor ( int $width , int $height ); //$width图像宽...原创 2020-02-12 10:47:56 · 1074 阅读 · 0 评论 -
【php随笔】一些小方法
一、获取一个二维数组的某个键的最大值 public function searchMax($arr, $field) { //判断是否是数组以及传过来的字段是否是空 if (!is_array($arr) || !$field) { return false; } $temp = array(); ...原创 2020-01-01 22:28:46 · 216 阅读 · 0 评论
分享