How does the ini_set function work in PHP and how can it be used to adjust memory_limit?

To adjust the memory_limit in PHP, you can use the ini_set function to dynamically change the PHP configuration settings. This can be useful when you need to increase the memory available to a specific script or application.

// Increase memory_limit to 256M
ini_set('memory_limit', '256M');