parse_ini_file

PHP 4, PHP 5, PHP 7, PHP 8
parse_ini_file - Parse a configuration file
Manual
Code Examples

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 ) ) )
PHP Version:

Example #2 parse_ini_file parsing a php.ini file

Result: (parsed) magic_quotes_gpc = Yes (loaded) magic_quotes_gpc = Yes
PHP Version:

Example #3 Contents of <span class='function-filename'>sample.ini</span>

PHP Version:

Example #4 Value Interpolation

PHP Version:

Example #5 Escaping Characters

PHP Version: