According to this link here I wrote a similar answer as in bottom. Wonder if there is more generic and compact way of writing the solution?
$multi_d = array();
$read_conf = parse_ini_file($filename);
foreach( $read_conf as $keys => $value)
{
$temp =& $multi_d;
foreach(explode( '.', $keys) as $key)
$temp =& $temp[$key];
$temp = trim( $value);
}