1. sleep() is a built-in function of PHP. Used to delay program execution for a given number of seconds. The function accepts only one parameter, which must be passed.
2. The $seconds parameter indicates the delay time in seconds.
Return value: Zero on success, FALSE on error. If the call is interrupted by a signal, the function will return a non-zero value.
When seconds are negative, this function generates E_WARNING, available for 4+.
grammar
int sleep(int $seconds)
Example
for($i=0;$i<5;$i++) { sleep(2); echo "6".PHP_EOL; }
The above is an introduction to the sleep() function in php. I hope it will be helpful to everyone. More PHP learning guide: source code network