How can a PHP script be made to wait for 3 seconds before continuing execution?
To make a PHP script wait for 3 seconds before continuing execution, you can use the `sleep()` function. This function pauses the script for the specified number of seconds before proceeding. By calling `sleep(3)`, the script will wait for 3 seconds before continuing with the rest of the code execution.
// Wait for 3 seconds
sleep(3);
// Continue with the rest of the code
echo "This will be displayed after waiting for 3 seconds.";
Related Questions
- What are the recommended coding standards and practices for PHP scripts to enhance security and readability?
- Can anyone recommend a reliable tutorial website for learning about Template classes and specifically phplib-Templates in PHP?
- What is the purpose of using nl2br and strip_tags functions in PHP?