Let's say, you have settings.ini file. You can use parse_ini_file() function to do this:
settings.ini
[base]
tz1 = "UTC+4:30 Asia/Kabul"
tz2 = "UTC+5:45 Asia/Katmandu"
tz3 = "UTC-4:30 America/Caracas"
PHP File
// Parse without sections
$ini_array = parse_ini_file("settings.ini");
print_r($ini_array);
This would output:
Array
(
[tz1] => "UTC+4:30 Asia/Kabul"
[tz2] => "UTC+5:45 Asia/Katmandu"
[tz3] => "UTC-4:30 America/Caracas"
)
Now you can get the value of tz2 and get the value as:
$ini = explode(" ", $ini_array["tz2"]);
$ini = str_replace("UTC", "", $ini);
So, your $ini value will be: +5:45.
You can also loop through it to get both the LHS and RHS. :)
^\w+(?=\s*=\s*"[^"]*\b5:45\b)parse_ini_file()in PHP, which helps you do this.