随笔分类 -  php

摘要:php的Allowed memory size of 134217728 bytes exhausted问题解决办法 报错: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 128 by 阅读全文
posted @ 2019-04-24 16:40 天道酬勤,坚持! 阅读(2931) 评论(0) 推荐(0) 编辑
摘要:使用下面直接进行处理$str = preg_replace('/[\x{10000}-\x{10FFFF}]/u', '', $str); 阅读全文
posted @ 2019-02-20 13:25 天道酬勤,坚持! 阅读(374) 评论(0) 推荐(0) 编辑
摘要:总结:使用redis列表来做秒杀活动还是不错的 阅读全文
posted @ 2017-11-27 16:15 天道酬勤,坚持! 阅读(2732) 评论(0) 推荐(0) 编辑
摘要:详细文档访问:https://github.com/Neeke/SeasLog/blob/master/README_zh.md 源码安装步骤: 1.先下载Seaslog源码,下载地址:http://pecl.php.net/package/SeasLog 2.对下载的包进行解压:tar -zxf 阅读全文
posted @ 2017-11-13 16:23 天道酬勤,坚持! 阅读(1719) 评论(0) 推荐(0) 编辑
摘要:问题: 解决方法: 1.重启mac电脑,同时按住command+R ,等出现进度条了再松开 2.弹出的界面是否有“实用工具”,有的话就打开实用工具里面的终端,输入:csrutil disable,然后回车 3.重新启动电脑。 4.去/usr目录下,(目录根据你自己电脑上的目录来)执行:sudo ln 阅读全文
posted @ 2017-11-13 15:33 天道酬勤,坚持! 阅读(3653) 评论(0) 推荐(0) 编辑
摘要:if (!function_exists('bccomp')) { /** * 支持正数和负数的比较 * ++ -- +- * @param $numOne * @param $numTwo * @param null $scale * @return int|string */ function bccom... 阅读全文
posted @ 2017-11-07 14:38 天道酬勤,坚持! 阅读(2111) 评论(0) 推荐(0) 编辑
摘要:$value) { $rand = mt_rand(1, $probabilitySum); if ($rand 10, 2 => 30, 3 => 40, 4 => 90, 10 => 100 ); var_dump(probability($data)); ... 阅读全文
posted @ 2017-02-23 10:28 天道酬勤,坚持! 阅读(220) 评论(0) 推荐(0) 编辑
摘要:function sorting_by_sale($arrUsers, $direction="desc"){ if(empty($arrUsers)){ return $arrUsers; } $direArr = array("desc"=>'SORT_DESC', 'asc'=>"SORT_ASC"); ... 阅读全文
posted @ 2016-06-15 16:33 天道酬勤,坚持! 阅读(232) 评论(0) 推荐(0) 编辑
摘要:1.php服务端:server.php 2.客户端: client.php 先在cmd下运行:php server.php文件,他会处于等待状态, 可以看到绑定的端口以及运行: 在cmd下运行: php client.php 阅读全文
posted @ 2016-04-22 15:11 天道酬勤,坚持! 阅读(311) 评论(0) 推荐(0) 编辑
摘要:请安装此网页的方法来安装: https://coding.net/u/idoubi666/p/weiphp-sae/git 阅读全文
posted @ 2016-04-19 15:54 天道酬勤,坚持! 阅读(372) 评论(0) 推荐(0) 编辑
摘要:其实像这样的php拓展很多,只是项目中没怎么用到: 阅读全文
posted @ 2016-04-18 17:45 天道酬勤,坚持! 阅读(371) 评论(0) 推荐(0) 编辑
摘要:1.md5加密,加密之后是32位的字符串 2.sha1加密, 加密之后是40位的字符串 3.crypt加密, 加密之后是13位的字符串 上面是不可逆的 可逆的如下urlencode --》 urldecode base64_encode --> base64_decode 不可逆的可以通过工具破解: 阅读全文
posted @ 2016-04-18 15:26 天道酬勤,坚持! 阅读(428) 评论(0) 推荐(0) 编辑
摘要:/** Method to execute a command in the terminal Uses : 1. system 2. passthru 3. exec 4. shell_exec */ function terminal($command) { //system if(function_exi... 阅读全文
posted @ 2016-03-25 09:40 天道酬勤,坚持! 阅读(255) 评论(0) 推荐(0) 编辑
摘要:结合chart.js插件,html代码: 效果如下: 阅读全文
posted @ 2016-03-21 15:57 天道酬勤,坚持! 阅读(474) 评论(0) 推荐(0) 编辑
摘要:使用普通用户来安装lamp环境: 1.安装apache: sudo apt-get install apache2 输入:y 安装完成之后查看是否安装成功: apache2 -v 2.安装php sudo apt-get install php5 安装完后查看是否安装成功: php5 -v 注意:a 阅读全文
posted @ 2016-02-16 11:41 天道酬勤,坚持! 阅读(426) 评论(0) 推荐(0) 编辑
摘要:2,"0"=>8,"0x"=>16); $remainderArr = array(10=>'a', 11=>'b', 12=>"c", 13=>'d', 14=>"e", 15=>"f"); $remainderArr_rev = array_flip($remainderArr); ... 阅读全文
posted @ 2016-01-18 15:27 天道酬勤,坚持! 阅读(352) 评论(0) 推荐(0) 编辑
摘要:2,"0"=>8,"0x"=>16); $remainderArr = array(10=>'a', 11=>'b', 12=>"c", 13=>'d', 14=>"e", 15=>"f"); if(!in_array($decimal, $arr)){ return ; ... 阅读全文
posted @ 2016-01-18 14:55 天道酬勤,坚持! 阅读(330) 评论(0) 推荐(0) 编辑
摘要:Is $z TRUE or FALSE?In this case, $z will be FALSE because the above code is equivalent to rather than as might be expected - because the OR operato... 阅读全文
posted @ 2016-01-18 11:53 天道酬勤,坚持! 阅读(156) 评论(0) 推荐(0) 编辑
摘要:name = "yu";$person->sex = "man";$person->school = array("a", "b", "c");$person->aa = func();function func(){ echo "11111";}echo $person->aa;print... 阅读全文
posted @ 2016-01-05 13:34 天道酬勤,坚持! 阅读(436) 评论(0) 推荐(0) 编辑
摘要:看这里的文档:http://www.phpddt.com/manual/php-security/ 阅读全文
posted @ 2015-12-31 15:02 天道酬勤,坚持! 阅读(142) 评论(0) 推荐(0) 编辑