Skip to content

Instantly share code, notes, and snippets.

@drm
Created January 27, 2012 10:50
Show Gist options
  • Save drm/1688256 to your computer and use it in GitHub Desktop.
Save drm/1688256 to your computer and use it in GitHub Desktop.
Hide the cursor in a PHP script with ANSI escape code
<?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