Easy Tutorial
❮ Func Ftp Mkdir Func Date Date Diff ❯

PHP parse_ini_file() Function



Definition and Usage

The parse_ini_file() function parses a configuration file (ini file) and returns the settings in an array format.

Syntax

Parameter Description
file Required. Specifies the ini file to be checked.
process_sections Optional. If set to TRUE, returns a multidimensional array including the names and settings of each section in the configuration file. Default is FALSE.

Tips and Notes

Tip: This function can be used to read configuration files of your own applications, and it is not related to the php.ini file.

Note: Some reserved words cannot be used as key names in ini files, including: null, yes, no, true, and false. The characters {}|&~![]() cannot be used anywhere in the key name.


Example 1

Contents of "test.ini":

PHP Code:

The above code will output:


Example 2

Contents of "test.ini":

PHP Code (with process_sections set to true):

The above code will output:


❮ Func Ftp Mkdir Func Date Date Diff ❯