PHP loading animation using spin marks

Display a loading animation using php.

$spin_marks = array('⠏', '⠛', '⠹', '⠼', '⠶', '⠧');
$ticks = 0;
while (true) {
    $ticks += 1;
    echo ' loading... ' . $spin_marks[$ticks % count($spin_marks)] . "\r";
    usleep(100000);
}

Screenshot:

If you liked this posting, please feel free to leave me a comment below.
View this page on GitHub.
Posted .

Comments

Leave a Reply