- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
parse_ini_file() function in PHP
The parse_ini_file() function parses a configuration file (ini)
Syntax
parse_ini_file(file_path, process_sections)
Parameters
file_path − The ini file to be parsed.
process_sections − If set to TRUE, you will get a multidimensional array with section names and settings included.
Return
The parse_ini_file() function returns the settings as an associative array on success. It returns FALSE on failure.
Let’s say the content of our “demo.ini” is −
[names] one = Anne two = Katie three = Tom [urls] host1 = "https://www.example1.com" host2 = "https://www.example2.com"
Example
<?php print_r(parse_ini_file("demo.ini")); ?>
Output
Array ( [one] => Anne [two] => Katie [three] => Tom [host1] => https://www.example1.com [host2] => https://www.example2.com )
Advertisements
To Continue Learning Please Login
Login with Google