Home > Backend Development > PHP Tutorial > parse_ini_file usage_PHP tutorial

parse_ini_file usage_PHP tutorial

WBOY
Release: 2016-07-13 17:37:29
Original
1080 people have browsed it

parse_ini_file is used to parse a configuration file

Configuration file

Such as config.ini

[host]

hostname = localhost

dbname = datebase

username = root

password = root

[smatyconf]

smarty_templates_dir=templates_dir

smarty_config_dir =config_dir

array parse_ini_file ( string filename [, bool process_sections] )

Read the ini file and save it as an array. If the proprocess_sections parameter is true, it will return an array

Above $confarr = parse_ini_file(config.ini);

print_r($confarr);

Result:

Array(

[hostname ]= >localhost

[dbname] => datebase

[username] => root

[password] = >root

[smarty_templates_dir] => templates_dir

[smarty_config_dir] => config_dir

)

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/486560.htmlTechArticleparse_ini_file is used to parse a configuration file configuration file such as config.ini [host] hostname = localhost dbname = datebase username = root password = root [smatyconf] smarty_templates_...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template