Use parse_ini_file( ):
$config = parse_ini_file('/etc/myapp.ini');
The function parse_ini_file( ) reads configuration files structured like PHP's main php.ini file. Instead of applying the settings in the configuration file to PHP's configuration, however, parse_ini_file( ) returns the values from the file in an array.
For example, when parse_ini_file( ) is given a file with these contents: