揮発性のメモ2

http://d.hatena.ne.jp/iww/

PHPで標準入力を読む

PHPの標準入力は、CGIコマンドラインかで異なる。


http://www.php.net/manual/ja/function.file-get-contents.php#110297
CGIのときは php://input を使う

<?
  $input = file_get_contents("php://input");
?>

コマンドラインのときは php://stdin を使う

<?
  $input = file_get_contents("php://stdin");
?>