[database] host = localhost username = myusername password = mypassword
$config = parse_ini_file('config.ini'); $settings = $config->getAll(); print_r($settings);
Array ( [database] => Array ( [host] => localhost [username] => myusername [password] => mypassword ) )
$config = new Zend_Config_Ini('config.ini'); $settings = $config->toArray(); print_r($settings);This will output similar array as example 1. The package library used in these examples is the Zend Config component which is a part of the Zend Framework.