Home > Backend Development > PHP Tutorial > parse_ini_file usage_PHP tutorial

parse_ini_file usage_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 17:37:29
Original
1116 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_...
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
Latest Issues
How to parse and process HTML/XML in PHP?
From 1970-01-01 08:00:00
0
0
0
How to parse and process HTML/XML in PHP?
From 1970-01-01 08:00:00
0
0
0
How to parse and process HTML/XML using PHP?
From 1970-01-01 08:00:00
0
0
0
Parse carbon element in date format
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template