Created
December 3, 2014 13:10
-
-
Save fejese/59184e28545287d33174 to your computer and use it in GitHub Desktop.
Example how to wait for a letter
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 | |
echo "pause\n"; | |
$stdin = fopen('php://stdin', 'r'); | |
$c = -1; | |
while ($c != '~') { | |
if ($c != -1) { | |
echo "still waiting...\n"; | |
} | |
$c = fgetc($stdin); | |
} | |
echo "continue\n"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment