Skip to content

Instantly share code, notes, and snippets.

@samkeen
Created August 2, 2011 20:05
Show Gist options
  • Save samkeen/1121079 to your computer and use it in GitHub Desktop.
Save samkeen/1121079 to your computer and use it in GitHub Desktop.
PHP spinner
<?php
function spinner($speed=200000)
{
static $counter;
$characters = array('|', '/', '-', '\\', '|', '-', '\\');
$backspace = "\010";
echo $characters[$counter % (count($characters)-1)];
usleep($speed);
echo $backspace;
$counter++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment