Are there any potential alternatives to changing the global settings for file size limits in PHP?

When faced with the issue of file size limits in PHP, one potential alternative to changing the global settings is to use the `ini_set()` function to temporarily modify the `upload_max_filesize` and `post_max_size` directives within the script itself. This allows for more flexibility in handling file uploads without affecting the global PHP configuration.

// Set temporary file size limits
ini_set('upload_max_filesize', '20M');
ini_set('post_max_size', '25M');

// Your file upload handling code here

// Reset file size limits to default
ini_set('upload_max_filesize', '2M');
ini_set('post_max_size', '8M');