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