中文字幕一区二区人妻电影,亚洲av无码一区二区乱子伦as ,亚洲精品无码永久在线观看,亚洲成aⅴ人片久青草影院按摩,亚洲黑人巨大videos

PHP parse_ini_file() 函數(shù)


PHP Filesystem 參考手冊 完整的 PHP Filesystem 參考手冊

定義和用法

parse_ini_file() 函數(shù)解析一個配置文件(ini 文件),并以數(shù)組的形式返回其中的設置。

語法

parse_ini_file(file,process_sections)
參數(shù) 描述
file 必需。規(guī)定要檢查的 ini 文件。
process_sections 可選。如果設置為 TRUE,則返回一個多維數(shù)組,包括了配置文件中每一節(jié)的名稱和設置。默認是 FALSE。

提示和注釋

提示:本函數(shù)可以用來讀取您自己的應用程序的配置文件,與 php.ini 文件沒有關系。

注釋:有些保留字不能作為 ini 文件中的鍵名,包括:null、yes、no、true 和 false。字符 {}|&~![()" 也不能用在鍵名的任何地方。


實例 1

"test.ini" 的內(nèi)容:

[names]
me = Robert
you = Peter

[urls]
first = "http://www.example.com"
second = ""

PHP 代碼:

<?php
print_r(parse_ini_file("test.ini"));
?>

上面的代碼將輸出:

Array
(
[me] => Robert
[you] => Peter
[first] => http://www.example.com
[second] =>
)

實例 2

"test.ini" 的內(nèi)容:

[names]
me = Robert
you = Peter

[urls]
first = "http://www.example.com"
second = "http://"

PHP 代碼(process_sections 設置為 true):

<?php
print_r(parse_ini_file("test.ini",true));
?>

上面的代碼將輸出:

Array
(
[names] => Array
(
[me] => Robert
[you] => Peter
)
[urls] => Array
(
[first] => http://www.example.com
[second] => http://
)
)

PHP Filesystem 參考手冊 完整的 PHP Filesystem 參考手冊其他擴展