-
-
Save sotayamashita/64c766b14e7ca90719efbd01626d161a to your computer and use it in GitHub Desktop.
Hide the cursor in a PHP script with ANSI escape code
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 | |
function hide_cursor($stream = STDOUT) { | |
fprintf($stream, "\033[?25l"); // hide cursor | |
register_shutdown_function(function() use($stream) { | |
fprintf($stream, "\033[?25h"); //show cursor | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment