parse_ini_file
PHP 4, PHP 5, PHP 7, PHP 8
parse_ini_file - Parse a configuration file
Example #1 parse_ini_file example
Result: Array
(
[one] => 1
[five] => 5
[animal] => Dodo bird
[path] => /usr/local/bin
[URL] => http://www.example.com/~username
[phpversion] => Array
(
[0] => 5.0
[1] => 5.1
[2] => 5.2
[3] => 5.3
)
[urls] => Array
(
[svn] => http://svn.php.net
[git] => http://git.php.net
)
)
Array
(
[first_section] => Array
(
[one] => 1
[five] => 5
[animal] => Dodo bird
)
[second_section] => Array
(
[path] => /usr/local/bin
[URL] => http://www.example.com/~username
)
[third_section] => Array
(
[phpversion] => Array
(
[0] => 5.0
[1] => 5.1
[2] => 5.2
[3] => 5.3
)
[urls] => Array
(
[svn] => http://svn.php.net
[git] => http://git.php.net
)
)
)
Example #2 parse_ini_file parsing a php.ini file
Result: (parsed) magic_quotes_gpc = Yes
(loaded) magic_quotes_gpc = Yes
Example #3 Contents of <span class='function-filename'>sample.ini</span>
Example #4 Value Interpolation
Example #5 Escaping Characters