例子
例子 1
"test.ini" 的内容:
[names]
me = Robert
you = Peter
[urls]
first = "http://www.example.com"
second = "http://www.w3school.com.cn"
PHP 代码:
print_r(parse_ini_file("test.ini"));
?>
输出:
Array
(
[me] => Robert
[you] => Peter
[first] => http://www.example.com
[second] => http://www.w3school.com.cn
)
例子 2
"test.ini" 的内容:
[names]
me = Robert
you = Peter
[urls]
first = "http://www.example.com"
second = "http://www.w3school.com.cn"
PHP 代码(process_sections 设置为 true):
print_r(parse_ini_file("test.ini",true));
?>
输出:
Array
(
[names] => Array
(
[me] => Robert
[you] => Peter
)
[urls] => Array
(
[first] => http://www.example.com
[second] => http://www.w3school.com.cn
)
)