Created
September 28, 2019 13:37
-
-
Save oppara/44297532357c04768286d4f8abf4b953 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