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 婶婶拜年祝福语大全简短