随笔分类 -  PHP

1 2 下一页

位运算-异或运算-只出现一次的数字-给定一个非空整数数组,除了某个元素只出现一次以外,其余每个元素均出现两次。找出那个只出现了一次的元素
摘要:给定一个非空整数数组,除了某个元素只出现一次以外,其余每个元素均出现两次。找出那个只出现了一次的元素。 示例: GO: PHP: 阅读全文

posted @ 2019-12-28 11:12 studyphp 阅读(634) 评论(0) 推荐(0) 编辑

composer 镜像地址
摘要:经过线上一段时间实测,还是华为的好用。 华为: composer config -g repos.packagist composer https://repo.huaweicloud.com/repository/php/ composer config -g repo.packagist com 阅读全文

posted @ 2019-02-26 10:06 studyphp 阅读(134) 评论(0) 推荐(0) 编辑

laravel 默认所有请求带session解决办法
摘要:laravel app/Http/Kernel.php 阅读全文

posted @ 2018-12-14 10:04 studyphp 阅读(450) 评论(0) 推荐(0) 编辑

unable to bind listening socket for address '127.0.0.1:9090': Address already in use (98)
摘要:unable to bind listening socket for address '127.0.0.1:9090': Address already in use (98) php-fpm 启动错误 9090 端口被占用,所以查看端口被谁占用 sudo netstat -lntup | gre 阅读全文

posted @ 2017-05-12 18:27 studyphp 阅读(997) 评论(0) 推荐(0) 编辑

PHP使用swoole来实现实时异步任务队列
摘要:转载来自第七星尘的技术博客的《PHP使用swoole来实现实时异步任务队列》 关于异步任务队列 用户打开了我们的网站。他要做的就是勾选需要发邮件的代理商列表,然后把结算邮件发出去。假如我们需要发1封邮件,我们写个函数执行即可。考虑到网络可能会稍微有点延迟,但是是可以接受的,用户会乖乖等你的网页发完邮 阅读全文

posted @ 2017-02-16 14:54 studyphp 阅读(5793) 评论(2) 推荐(0) 编辑

PHP redis 群发短信
摘要:$redis = new \Redis(); $redis->connect('127.0.0.1', 6379); $list = M('Sms')->field('phone')->where(array('s'=>0))->select(); ; for ($i=0; $i lpush('list',$list[$i]['phone']);... 阅读全文

posted @ 2017-02-16 14:15 studyphp 阅读(469) 评论(0) 推荐(0) 编辑

PHP字符串反转
摘要:function getRev($str,$encoding='utf-8'){ $result = ''; $len = mb_strlen($str); for($i=$len-1; $i>=0; $i--){ $result .= mb_substr($str,$i,1,$encoding); } ... 阅读全文

posted @ 2017-02-14 12:13 studyphp 阅读(134) 评论(0) 推荐(0) 编辑

PHP字符串截取
摘要://字符串截取 function utf8_substr($str, $start, $length) { $i = 0; //完整排除之前的UTF8字符 while($i < $start) { $ord = ord($str{$i}); if($ord < 192) { $i++; } elsei... 阅读全文

posted @ 2017-02-09 17:18 studyphp 阅读(166) 评论(0) 推荐(0) 编辑

PHP数组对象互转
摘要://数组转对象 function array2object($array) { if (is_array($array)) { $obj = new StdClass(); foreach ($array as $key => $val){ $obj->$key = $val; } } else { ... 阅读全文

posted @ 2017-02-09 17:16 studyphp 阅读(154) 评论(0) 推荐(0) 编辑

PHP 过滤特殊符号
摘要:function strFilter($str){ $str = str_replace('`', '', $str); $str = str_replace('·', '', $str); $str = str_replace('~', '', $str); $str = str_replace('!', '', $str); $str = str_re... 阅读全文

posted @ 2017-02-09 17:11 studyphp 阅读(603) 评论(0) 推荐(0) 编辑

PHP去除重复的数组数据
摘要:PHP去除重复的数组数据 "green","", "red","b" => "green", "","blue", "red","c" => "witer","hello","witer"); //$result = array_unique($input); //去除重复元素 $result = a_array_unique($input); 阅读全文

posted @ 2017-02-09 17:04 studyphp 阅读(195) 评论(0) 推荐(0) 编辑

PHP 判断字符串括号是否匹配
摘要:<?php function aa($str) { $temp = array(); for ($i = 0; $i < strlen($str); $i++) { $t = $str[$i]; switch ($t) { case '(': array_push($temp, '('); ... 阅读全文

posted @ 2017-02-09 16:45 studyphp 阅读(438) 评论(0) 推荐(0) 编辑

jquery Nestable 获取改变排序后的json数据 拖动排序
摘要:以上代码用来获取操作后的json 数据,传递给后台,进行数据排序处理。 以下为我的操作: 阅读全文

posted @ 2017-02-08 14:48 studyphp 阅读(626) 评论(0) 推荐(0) 编辑

PHP图片处理库Grafika详细教程
摘要:转载自51CTO 开发频道 1、图像基本处理:http://developer.51cto.com/art/201611/520928.htm 2、图像特效处理模块:http://developer.51cto.com/art/201611/520930.htm 3、图像属性处理:http://de 阅读全文

posted @ 2017-02-06 10:54 studyphp 阅读(556) 评论(0) 推荐(0) 编辑

Thinkphp Exception捕获异常失败
摘要:try catch 比较坑,默认这样是走TP 的错误模板页面 自定义的话: 阅读全文

posted @ 2016-11-23 17:29 studyphp 阅读(772) 评论(0) 推荐(0) 编辑

PHP 图片生成文字
摘要:$dst_path = './1.png'; $font_file = './ADOBEHEITISTD-REGULAR (V5.010).OTF'; $img_bg = imagecreatefrompng($dst_path); //打开图片, $bg_width = imagesx($img_bg); $clr = ImageColorAllocate($img_bg, 0xFF,0xFF... 阅读全文

posted @ 2016-11-23 17:27 studyphp 阅读(673) 评论(0) 推荐(0) 编辑

mysql 统计
摘要:每周: select count(*) as cnt,week(editdate) as weekflg from projects where year(editdate)=2007 group by weekflg 每月: select count(*) as cnt,month(editdat 阅读全文

posted @ 2016-09-27 10:19 studyphp 阅读(201) 评论(0) 推荐(0) 编辑

IAP 破解漏洞验证
摘要:IAP支付有个漏洞,用户使用的可能是IAP Free 或者俄罗斯破解什么的,所产生的交易号:170000029449420 product_id:com.zeptolab.ctrbonus.superpower1 忽略了除了去Appstore验证receipt 还需要验证product_id 并且交 阅读全文

posted @ 2016-08-17 17:40 studyphp 阅读(475) 评论(0) 推荐(0) 编辑

TP QQ 微信 微博登录
摘要:类文件打包下载: https://pan.baidu.com/s/1slH1VEt 阅读全文

posted @ 2016-07-21 19:53 studyphp 阅读(1489) 评论(0) 推荐(0) 编辑

PHP TP 生成二维码
摘要:二维码类下载地址https://pan.baidu.com/s/1c2zB5D2 阅读全文

posted @ 2016-07-21 19:48 studyphp 阅读(320) 评论(0) 推荐(0) 编辑

1 2 下一页

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示