PHP: Read from STDIN in CLI mode

If you need to read data from STDIN in a CLI based PHP script:

$str = file_get_contents("php://stdin");
Leave A Reply
All content licensed under the Creative Commons License