How can the `ini_set` function be applied to a custom ini file in PHP?

To apply the `ini_set` function to a custom ini file in PHP, you can use the `parse_ini_file` function to read the custom ini file and then loop through the settings to set them using `ini_set`. This allows you to apply custom configuration settings from a separate ini file to your PHP script.

$customIniFile = 'custom.ini';
$customSettings = parse_ini_file($customIniFile);

foreach ($customSettings as $key => $value) {
    ini_set($key, $value);
}