
PHP
今夜大风
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
php 如何处理 emoji 表情,保存到 mysql
不考虑数据库的编码格式什么之类的,最直接的方法就是把文本中的 emoji 转换成文本保存。取出的时候再将文本转换成 emoji 表格即可。转载 2023-04-25 11:11:54 · 423 阅读 · 0 评论 -
composer报错:A temporary file could not be opened to write the process output:
问题:在winserver2012服务器上安装composer 后,使用composer报错A temporary file could not be opened to write the process output: fopen(C:\Users\ADMINI~1\AppData\Local\Temp\2\sf_proc_00.out.lock): failed to open stream: No such file or directory解决:打开php.ini配置文件,找到sys_te原创 2022-02-23 16:44:08 · 598 阅读 · 0 评论 -
cURL error 60: SSL certificate problem: unable to get local issuer certificate
一、进入https://curl.haxx.se/docs/caextract.html随便选一个下载到本地二、编辑php.ini文件curl.cainfo=“文件地址”注意对应PHP版本目录下的ini三、开启SSL扩展,并重启服务器原创 2021-12-02 16:14:38 · 2104 阅读 · 0 评论 -
PHP获得数组交集与差集的方法
一、数组的交集 array_intersect()array_intersect()函数返回一个保留了键的数组,这个数组只由第一个数组中出现的且在其他每个输入数组中都出现的值组成。其形式如下:array array_intersect(array array1,array array2[,arrayN…])下面这个例子将返回在fruit1数组中出现的且在fruit1数组中出现的且在fruit1数组中出现的且在fruit2和$fruit3中也出现的所有的水果:<?php$fruit1 = ar转载 2021-11-26 15:41:53 · 609 阅读 · 0 评论 -
PHP获取浏览器,PHP获取IP地址,PHP获取设备型号
<?php//获取浏览器function get_broswer(){ $sys = $_SERVER['HTTP_USER_AGENT']; //获取用户代理字符串 $exp[0] = "未知浏览器"; $exp[1] = ""; //stripos() 函数查找字符串在另一字符串中第一次出现的位置(不区分大小写) preg_match()执行匹配正则表达式 if (stripos($sys, "Firefox/") > 0) {原创 2021-11-22 16:30:19 · 2631 阅读 · 0 评论 -
将一个字符串部分字符用*替代隐藏
/** * +---------------------------------------------------------- * 将一个字符串部分字符用*替代隐藏 * http://www.thinkphp.cn/code/94.html * +---------------------------------------------------------- * @param string $string 待转换的字符串 * @param原创 2021-10-08 16:14:16 · 270 阅读 · 0 评论 -
PHP 友好时间提示
/** * 友好时间提示 * * @param int $time 时间戳 * @return bool|false|string */ function date_friend_tips($time) { if (!$time) return false; if (!is_numeric($time)) { $time = strtotime($time);原创 2021-10-08 16:10:55 · 170 阅读 · 0 评论 -
ThinkPHP Where 条件中使用表达式
Where 条件表达式格式为:$map['字段名'] = array('表达式', '操作条件');其中 $map 是一个普通的数组变量,可以根据自己需求而命名。上述格式中的表达式实际是运算符的意义:ThinkPHP运算符 与 SQL运算符 对照表TP运算符SQL运算符例子实际查询条件eq=$map['id'] = array('eq',100);等效于:$map['id'] = 100;ne...转载 2018-05-27 15:59:45 · 251 阅读 · 0 评论 -
解决:Call to undefined function mb_detect_encoding()
Linux:首先使用yum或者apt安装mbstring.so,使用命令:yum install php-mbstring或者apt-get install php-mbstring (ubuntu用户最好使用apt-cache search mbstring搜索一番后再安装,软件名字可能有误)然后修改php.ini:执行vim /etc/php.ini,加入extension="/usr/lib...转载 2018-05-22 11:57:48 · 6552 阅读 · 0 评论 -
个人收集项目常用方法合集
一、快速生成订单号:public function orderNorandom($length,$start){//$length默认11位随机,$start订单号前缀,JT20180517123456789101 $code_arr=["1","2", "3", "4", "5", "6", "7", "8", "9",&am原创 2018-05-18 09:07:11 · 233 阅读 · 0 评论 -
PHP图片压缩方法
//图片压缩function ImageCondens($filepase){ list($new_width,$new_height,$imgtype)=getimagesize($filepase); // dump($new_width.','.$new_height.','.$imgtype); if($new_width>640){//640为自定义宽度 ...转载 2018-05-17 15:58:17 · 785 阅读 · 0 评论 -
PHP生成二维码
/** * 功能:生成二维码 * @param string $qr_data 手机扫描后要跳转的网址 * @param string $qr_level 默认纠错比例 分为L、M、Q、H四个等级,H代表最高纠错能力 * @param string $qr_size 二维码图大小,1-10可选,数字越大图片尺寸越大 * @param string $save...转载 2018-05-17 15:56:47 · 169 阅读 · 0 评论 -
php使用smtp发送邮件报错Cannot connenct to relay host
使用DEDEcms自定义了一个发送邮件的php文件,使用了dedecms自带的mail.class.php,在本地可以正常发送,上传到服务器上后,出现提示Cannot connenct to relay host smtp.qq.com Error: () Error: Cannot send email to XXX@qq.com 网上找了一大堆文章,终于解决,问题出在服务器的环境配置上。找到p...转载 2018-05-17 15:50:18 · 1535 阅读 · 0 评论 -
php7安装卸载
一、安装一个命令搞定:安装php7和apache的php7模块:apt-get install php7.0 libapache2-mod-php7.0重启apache:/etc/init.d/apache2 restart在/var/www/html目录下新建文件info.php内容如下:<?php phpinfo()?> 123访问:http://你的主机IP/inf...转载 2018-05-17 11:17:10 · 4803 阅读 · 1 评论