![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PHP
弱鸡小码农
qter
展开
-
PHP类继承父类时,用类名做构造函数测试
突然想到 所以测试了下上代码class Dog extends Animal{ function say($word){ echo $word; } }class Animal{ function Animal($name){ echo $name; } }$dog = new Dog('wangcai'); echo "<br>";原创 2017-03-02 09:52:24 · 342 阅读 · 0 评论 -
explode将字符串打散成数组后的顺序问题
implode函数在手册的说明里有一句:Returns a string containing a string representation of all the array elements in the same order, with the glue string between each element. 但是explode 中没有相关描述。我从网上找到了explode 的C实现源码,但原创 2017-03-09 09:49:48 · 799 阅读 · 0 评论 -
js和php中if判断空数组的差异
今天看到串代码做了个小测试js中var aa = [] if (aa){ console.log(aa); } php中$aa = []; if (!$aa){ var_dump($aa); } js中空数组是一个对象,可转型为true;php中空数组则为false。原创 2017-03-15 11:18:08 · 671 阅读 · 0 评论 -
集成GatewayWorker和Thinkphp5
命令行输入composer命令:composer create-project topthink/think tp5 --prefer-dist 稍等片刻thinkphp即可安装完成 安装完成thinkphp后再安装gatewayworker 命令行切换到tp根目录,运行命令:composer require workerman/gateway-worker-for-win 创建push\con原创 2017-06-21 16:46:56 · 5358 阅读 · 2 评论 -
辨析 new self(); new static();
辨析new self(); new static(); 参见class A { public static function get_self() { return new self(); } public static function get_static() { return new static(); } }class B ext转载 2017-07-12 11:30:40 · 274 阅读 · 0 评论 -
用PHP快速开发一个爬虫,用到的开源库
当出现快速开发字样的时候就说明不能从零开始了。所以推荐以下三方库。http请求库 以下两个request 要求php: >=5.2guzzle 要求php: >=5.5有条件还是采用guzzlehtml解析库phpQuerysimple_html_dom再有想到的再来补充原创 2017-11-27 17:29:15 · 789 阅读 · 0 评论 -
thinkphp5.1完美集成gatewayworker,支持windows/linux
下载链接thinkphp5.1完美集成gatewayworker 已经完成基础集成:businessworker启动后可以在代码中使用TP的绝大部分类库, 同时实现在TPweb项目中使用gatewayclient的推送能力,做了linux/windows下的两套启动文件。 所有文件都是composer安装,可以使用composer update直接更新各组件...原创 2018-05-08 10:08:32 · 6052 阅读 · 0 评论 -
thinkphp 访问输出 No input file specified.
.htaccess文件中的 RewriteRule ^(.*)index.php/index.php/ index.php/1 [QSA,PT,L] 在默认情况下会导致No input file specified. 修改重写规则可以解决改问题 网上大多解决方案是:加个问号, RewriteRule ^(.*)index.php?/index.php?/ index.php?/1 [QS...原创 2018-06-29 13:51:21 · 1580 阅读 · 0 评论