parse_ini_string()函数解析配置字符串。该函数在成功时返回设置的关联数组。在失败时返回FALSE。
parse_ini_string(file_path, process_sections)
file_path − The ini file to be parsed.
process_sections − If set to TRUE, you will get a multidimensional array with section names and settings included.
The parse_ini_string() function returns the settings as an associative array on success. It returns FALSE on failure.
立即学习“PHP免费学习笔记(深入)”;
Let’s say the content of our “demo.ini” is −
[names] one = Anne [urls] host1 = "https://www.example1.com"
<?php print_r(parse_ini_string("demo.ini")); ?>
Array ( [one] => Anne [host1] => https://www.example1.com )
以上就是在PHP中的parse_ini_string()函数的详细内容,更多请关注php中文网其它相关文章!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号