通知短信+运营短信,5秒速达,支持群发助手一键发送🚀高效触达和通知客户 广告
# [**支持的协议和封装协议**](https://www.php.net/manual/zh/wrappers.php) PHP 带有很多内置 URL 风格的封装协议,可用于类似[fopen()](https://www.php.net/manual/zh/function.fopen.php)、[copy()](https://www.php.net/manual/zh/function.copy.php)、[file\_exists()](https://www.php.net/manual/zh/function.file-exists.php)和[filesize()](https://www.php.net/manual/zh/function.filesize.php)的文件系统函数。 除了这些封装协议,还能通过[stream\_wrapper\_register()](https://www.php.net/manual/zh/function.stream-wrapper-register.php)来注册自定义的封装协议 * [file://](https://www.php.net/manual/zh/wrappers.file.php)— 访问本地文件系统 * [http://](https://www.php.net/manual/zh/wrappers.http.php)— 访问 HTTP(s) 网址 * [ftp://](https://www.php.net/manual/zh/wrappers.ftp.php)— 访问 FTP(s) URLs * [php://](https://www.php.net/manual/zh/wrappers.php.php)— 访问各个输入/输出流(I/O streams) * `php://input` 只读信息流 当请求方式是post的,并且enctype不等于”multipart/form-data”时,可以使用php://input来获取原始请求的数据 * 。。。查看:php://小节 * [zlib://](https://www.php.net/manual/zh/wrappers.compression.php)— 压缩流 * [data://](https://www.php.net/manual/zh/wrappers.data.php)— 数据(RFC 2397) * [glob://](https://www.php.net/manual/zh/wrappers.glob.php)— 查找匹配的文件路径模式 * [phar://](https://www.php.net/manual/zh/wrappers.phar.php)— PHP 归档 * [ssh2://](https://www.php.net/manual/zh/wrappers.ssh2.php)— Secure Shell 2 * [rar://](https://www.php.net/manual/zh/wrappers.rar.php)— RAR * [ogg://](https://www.php.net/manual/zh/wrappers.audio.php)— 音频流 * [expect://](https://www.php.net/manual/zh/wrappers.expect.php)— 处理交互式的流 **PHP.ini** * allow\_url\_fopen :on 默认开启 该选项为on便是激活了 URL 形式的 fopen 封装协议使得可以访问 URL 对象文件等。 * allow\_url\_include:off 默认关闭,该选项为on便是允许 包含URL 对象文件等 $HTTP_RAW_POST_DATA post原始数据,php5.6弃用,php7.0移除,不建议使用,请使用php://input代替 php://input是个可以访问请求的原始数据的只读流 ``` //将表单提交到服务端 <form action="" method="POST"> name: <input type="text" name="name" value="tom" /><br /> age:<input type="text" name="age" value="22" /><br /> <input type="submit" value="Submit" /> </form> //服务端使用file_get_contents获取php://input内容 $content = file_get_contents("php://input"); echo $content; //输出name=tom&age=22 parse_str($content), $_OUTPUT);//Array ( [name] => tom [age] => 22 ) ``` ``` <form action="" method="POST"> name: <input type="text" name="name" value="tom" /><br /> age:<input type="text" name="age" value="22" /><br /> <input type="submit" value="Submit" /> </form> <?php // 解析“PUT”请求的示例 parse_str(file_get_contents('php://input'), $_OUTPUT); // 结果 print_r($_OUTPUT);//Array ( [name] => tom [age] => 22 ) ```