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");


Note: Replies will be formatted with PHP Markdown Extra syntax.

Name: Email (Not Required):
 
Logged IP: 3.145.176.228
To prevent spam please submit by clicking the kitten: