note 110297 added to function.file-get-contents
| From: | leomac at inbox dot ru | Date: | Tue, 09 Oct 2012 09:29:38 +0000 |
| Subject: | note 110297 added to function.file-get-contents | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-191199@lists.php.net to get a copy of this message | ||
Reading all script input is simple task with file_get_contents, but it depends on what SAPI is being
used.
Only in Apache, not in CLI:
<?php
$input = file_get_contents("php://input");
?>
Only in CLI, not in Apache:
<?php
$input = file_get_contents("php://stdin");
?>
In Apache php://stdin will be empty, in CLI php://input will be empyt instead with no error
indication.
----
Server IP: 69.147.83.199
Probable Submitter: 194.85.80.62
----
Manual Page -- http://www.php.net/manual/en/function.file-get-contents.php
Edit -- https://master.php.net/note/edit/110297
Del: integrated -- https://master.php.net/note/delete/110297/integrated
Del: useless -- https://master.php.net/note/delete/110297/useless
Del: bad code -- https://master.php.net/note/delete/110297/bad+code
Del: spam -- https://master.php.net/note/delete/110297/spam
Del: non-english -- https://master.php.net/note/delete/110297/non-english
Del: in docs -- https://master.php.net/note/delete/110297/in+docs
Del: other reasons-- https://master.php.net/note/delete/110297
Reject -- https://master.php.net/note/reject/110297
Search -- https://master.php.net/manage/user-notes.php