How can the set_time_limit() function be used to extend the timeout in PHP scripts?

The set_time_limit() function in PHP can be used to extend the timeout for script execution. This function sets the maximum execution time for the script in seconds. By calling this function with a higher value, you can increase the timeout for the script to prevent it from being terminated prematurely.

// Extend the timeout to 60 seconds
set_time_limit(60);

// Your PHP script code here