php
qq_42724459
这个作者很懒,什么都没留下…
展开
-
php转发上传文件请求
public function upload(){ ini_set('upload_max_filesize', '20M'); ini_set('post_max_size', '20M'); ini_set('memory_limit', '128M'); $file = $_FILES['file']; if ($file['error'] != 0) { // 文件上传错误原创 2021-08-04 13:51:57 · 234 阅读 · 0 评论 -
Guzzle http异步请求
// 中文文档 [添加链接描述](https://guzzle-cn.readthedocs.io/zh_CN/)// POSTrequire_once __DIR__ . '/vendor/autoload.php';$client = new \GuzzleHttp\Client();// 发送 application/x-www-form-urlencoded POST请求需要你传入 form_params 数组参数,数组内指定POST的字段。$request = new \GuzzleHt原创 2021-04-21 15:43:58 · 1165 阅读 · 0 评论 -
php fsockopen 异步任务
function async( $verb = 'GET', /* HTTP Request Method (GET and POST supported) */ $ip, /* Target IP/Hostname */ $port = 80, /* Target TCP port */ $uri = '/', /* Target URI */原创 2021-04-15 13:34:59 · 111 阅读 · 0 评论 -
tp6 获取所有类方法和注解
function getControllers($dir){ $pathList = glob($dir . '/*.php'); $res = []; foreach($pathList as $key => $value) { $res[] = basename($value, '.php'); } return $res;}function getActions($className, $base='\app\BaseControll原创 2021-03-10 13:12:49 · 719 阅读 · 0 评论