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.21.248.119
To prevent spam please submit by clicking the kitten: