How can a PHP script display text after a certain amount of time has passed?

To display text after a certain amount of time has passed in a PHP script, you can use the sleep() function to pause the script execution for the desired amount of time before displaying the text.

<?php
// Wait for 5 seconds
sleep(5);

// Display the text after 5 seconds
echo "This text will be displayed after 5 seconds.";
?>