
php
传说中胖子
这个作者很懒,什么都没留下…
展开
-
宝塔面板nginx开启pathinfo模式无效
宝塔php7.*版本在win10下有点问题获取不到$_SERVER[PATH_INFO] ,php8.*可以正常使用。修改\BtSoft\nginx\conf\php目录下对应的.conf文件,下面以74.conf为例修改。win10安装宝塔,thinkphp5使用pathinfo模式访问404(原创 2024-05-13 11:57:19 · 511 阅读 · 0 评论 -
thinkphp6 跨模块调用
thinkphp6 跨模块调用方法原创 2023-02-20 14:49:34 · 960 阅读 · 0 评论 -
MQTT报文解释
MQTT报文解释原创 2022-11-16 11:56:18 · 541 阅读 · 0 评论 -
php使用com调用dll
php如何使用DynamicWrapperX调用任意dll文件原创 2022-11-10 02:34:19 · 1528 阅读 · 0 评论 -
PHP随机红包
PHP随机红包算法原创 2022-07-28 19:20:16 · 185 阅读 · 0 评论 -
阿里云函数基础使用
Http调用模式<?phpuse RingCentral\Psr7\Response;function handler($request, $context): Response{ $body = $request->getBody()->getContents(); $queries = $request->getQueryParams(); $method = $request->getMethod(); .原创 2022-05-13 16:07:46 · 698 阅读 · 0 评论 -
Yaf cli和http两种访问模式
//php yaf.php test/test/test aaa bbb #aaa,bbb是参数$application = new Yaf_Application( APPLICATION_PATH . "/conf/application.ini");if(php_sapi_name()=="cli"){ //加载cli的bootstrap配置内容 $application->bootstrap(); $uri_r = explode('/',$argv.原创 2022-04-25 17:28:41 · 371 阅读 · 0 评论 -
Yaf路由使用
修改\application\Bootstrap.php文件的路由方法 public function _initRoute(Yaf_Dispatcher $dispatcher) { //在这里注册自己的路由协议,默认使用简单路由 //通过派遣器得到默认的路由器 $router = Yaf_Dispatcher::getInstance()->getRouter(); //index.php?/list/12 //list方法中使用$this->getRequest原创 2022-04-25 16:47:55 · 611 阅读 · 0 评论 -
php返回结果,后端继续执行
set_time_limit(0); //不设置超时时间fastcgi_finish_request(); // 响应完成, 立即返回到前端,关闭连接(需要运行在FastCGI模式)1、ignore_user_abort(boolean); //在关闭连接后,继续运行php脚本如果设置为 true,则忽略与用户的断开,如果设置为 false,会导致脚本停止运行。2、使用register_shutdown_function(); //注册一个会在PHP中止时执行的函数...原创 2022-01-27 13:58:30 · 5287 阅读 · 0 评论 -
php自动时间转换
/** * ('2021-11-11')->1636560000 * (1636560000)->'2021-11-11 00:00:00' * (1636560000,'date')->'2021-11-11' * ('+1 day')->'2021-11-12 14:00:00' * ('+1 day','time')->'14:00:00' */function now($st=null,$format=null){ $f = $format=="dat.原创 2021-11-11 14:36:04 · 472 阅读 · 0 评论 -
php nginx 实时输出
header('X-Accel-Buffering: no');set_time_limit(0);ob_end_clean();ob_implicit_flush();原创 2020-11-22 21:46:25 · 127 阅读 · 0 评论 -
socket.io的php客户端
<?php/** * Class WebsocketClient * $client = new WebsocketClient('127.0.0.1', '3000'); * * $client->send(['msg' => 'hello']); //websocket * $client->emit('msg', 'hello'); //socket.io * * $response = $client->receive(); */.转载 2020-09-30 17:59:56 · 734 阅读 · 0 评论 -
php通用curl操作
function _curl($url, $data="", $type="POST", $options=null){ if(empty($url)){ return false; } $type = in_array(strtoupper($type), ['POST','GET','PUT','PATCH','DELETE']) ? $type : "POST"; $connect_timeout =...原创 2020-09-11 14:58:49 · 1117 阅读 · 0 评论 -
php 关键词过滤
$badword = array( '张三','张三丰','张三丰田' ); $badword1 = array_combine( $badword, array_fill(0, count($badword), '*') ); $bb = '我今天开着张三丰田上班'; $str = strtr($bb, $badword1); echo ...原创 2019-11-28 15:21:25 · 483 阅读 · 1 评论