Is there any form to detect the end of a console input?
Im using something like this:
<?php
while($consoleInput = fgets(S开发者_运维问答TDIN)) {
//do something
}
?>
Any sugestions?
How about feof()
? Untested, but I believe this will work.
while (!feof(STDIN)) {
$consoleInput = fgets(STDIN);
}
if (feof(STDIN)) {
do_something()
};
精彩评论