Skip to content

Instantly share code, notes, and snippets.

@kobus1998
Created December 16, 2020 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kobus1998/e41564d7e58fb2444ce4abeda59fb37e to your computer and use it in GitHub Desktop.
Save kobus1998/e41564d7e58fb2444ce4abeda59fb37e to your computer and use it in GitHub Desktop.
flush example
<?php
echo "Begin ...\n";
for( $i = 0 ; $i < 10 ; $i++ )
{
echo $i . "\n";
flush();
sleep(1);
}
echo "End ...\n";
/*
every second it should show a number
output:
Begin ...
0
1
2
3
4
5
6
7
8
9
End ...
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment