What function can be used to read a config file in PHP?
To read a config file in PHP, you can use the `parse_ini_file()` function. This function reads the contents of an INI file and returns an associative array containing the configuration settings.
$config = parse_ini_file('config.ini');
print_r($config);
Keywords
Related Questions
- What considerations should be made when integrating a forum feature into a PHP website, and how can these challenges be addressed effectively?
- How can code readability be improved by breaking down PHP code into multiple lines?
- How can the error "Object of class stdClass could not be converted to string" be resolved in PHP?