Last active
September 28, 2019 13:37
-
-
Save oppara/52fa99953c8d3d04109e6e0ce739dcb6 to your computer and use it in GitHub Desktop.
PHPで標準入力から値を取得
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$inputs = []; | |
while (true) { | |
$in = trim(fgets(STDIN)); | |
if ($in === '') { | |
var_dump($inputs); | |
return; | |
} | |
$inputs[] = $in; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$in = trim(fgets(STDIN)); | |
var_dump($in); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment