I would like to make use of somehting like [parse_ini_file][1].
Lets say for instance I have a boot.ini file that I will load for further procedure:
$ini_array = parse_ini_file("sample.ini");
$ini = new stdclass;
foreach ($ini_array as $key => $value) {
$last = substr(strrchr($key, '.'), 1);
if (!$last) $last = $key;
$node = $ini;
foreach (explode('.', $key) as $key2) {
if (!isset($node->$key2)) {
$node->$key2 = new stdclass;
}
if ($key2 == $last) {
$node->$key2 = $value;
} else {
$node = $node->$key2;
}
}
}
var_dump($ini->db->host1->type);