PHP中的parse_ini_file()函数
parse_ini_file()函数解析配置文件(ini)
语法
parse_ini_file(file_path, process_sections)
参数
file_path-要解析的ini文件。
process_sections-如果设置为TRUE,您将获得一个包含部分名称和设置的多维数组。
返回
成功时,parse_ini_file()函数将设置作为关联数组返回。失败时返回FALSE。
假设我们的“demo.ini”的内容是-
[names] one = Anne two = Katie three = Tom [urls] host1 = "https://www.example1.com" host2 = "https://www.example2.com"
示例
<?php
print_r(parse_ini_file("demo.ini"));
?>输出结果
Array ( [one] => Anne [two] => Katie [three] => Tom [host1] => https://www.example1.com [host2] => https://www.example2.com )
热门推荐
10 财运虎年祝福语简短语
11 单亲爸爸春节祝福语简短
12 狗狗上厕所训练
13 植物种植祝福语简短
14 翻译考试祝福语朋友简短
15 个人周年庆简短祝福语
16 狗狗怎么训练
17 分别祝福语简短搞笑英文
18 生日广州男生祝福语简短