且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从命令行将数据放入php:// input

更新时间:2023-11-29 16:58:04

php:// input 仅适用于从Web服务器运行的脚本。

php://input only works for scripts run from the webserver.

当CLI脚本需要访问标准输入时,它们使用 php: // stdin ,或已打开的流 STDIN

When CLI scripts need to access standard input, they use php://stdin, or the already opened stream STDIN:

<?php echo file_get_contents('php://stdin'); ?>

<?php echo stream_get_contents(STDIN); ?>