English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The parse_ini_file() function can parse configuration (ini) files and return the settings in array form.
array parse_ini_file ( string $filename [, bool $process_sections = FALSE [, int $scanner_mode = INI_SCANNER_NORMAL ]] )
This function can load the ini file specified in the filename and return the settings in the form of an associative array. The structure of the ini file is the same as that of php.ini.
<?php print_r(parse_ini_file("/PhpProject/simple.ini")); ?>
Output Result
Array ( [me] => Adithya [you] => Jai [first] => http://www.oldtoolbag.com [second] => https://www.google.com )
<?php print_r(parse_ini_file("/PhpProject/simple.ini", true)); ?>
Output Result
Array ( [names] => Array ( [me] => Adithya [you] => Jai ) [urls] => Array ( [first] => http://www.oldtoolbag.com [second] => https://www.google.com ) )PHP Filesystem Reference Manual