Is there any form to detect the end of a console input?
Im using something like this:
<?php
while($consoleInput = fgets(STDIN)) {
//do something
}
?>
Any sugestions?
Is there any form to detect the end of a console input?
Im using something like this:
<?php
while($consoleInput = fgets(STDIN)) {
//do something
}
?>
Any sugestions?
How about feof()? Untested, but I believe this will work.
while (!feof(STDIN)) {
$consoleInput = fgets(STDIN);
}