|
update : 2015.11.03
php.shukuma.com검색:
|
parse_ini_file(PHP 4, PHP 5, PHP 7) parse_ini_file — Parse a configuration file 설명
array parse_ini_file
( string
$filename
[, bool $process_sections = false
[, int $scanner_mode = INI_SCANNER_NORMAL
]] )
parse_ini_file() loads in the
ini file specified in The structure of the ini file is the same as the php.ini's. 인수
반환값
The settings are returned as an associative array on success,
and 변경점
예제
Example #1 Contents of sample.ini ; This is a sample configuration file ; Comments start with ';', as in php.ini [first_section] one = 1 five = 5 animal = BIRD [second_section] path = "/usr/local/bin" URL = "http://www.example.com/~username" [third_section] phpversion[] = "5.0" phpversion[] = "5.1" phpversion[] = "5.2" phpversion[] = "5.3" urls[svn] = "http://svn.php.net" urls[git] = "http://git.php.net" Example #2 parse_ini_file() example Constants may also be parsed in the ini file so if you define a constant as an ini value before running parse_ini_file(), it will be integrated into the results. Only ini values are evaluated. For example:
<?php위 예제의 출력 예시:
Array
(
[one] => 1
[five] => 5
[animal] => Dodo bird
[path] => /usr/local/bin
[URL] => http://www.example.com/~username
[phpversion] => Array
(
[0] => 5.0
[1] => 5.1
[2] => 5.2
[3] => 5.3
)
[urls] => Array
(
[svn] => http://svn.php.net
[git] => http://git.php.net
)
)
Array
(
[first_section] => Array
(
[one] => 1
[five] => 5
[animal] => Dodo bird
)
[second_section] => Array
(
[path] => /usr/local/bin
[URL] => http://www.example.com/~username
)
[third_section] => Array
(
[phpversion] => Array
(
[0] => 5.0
[1] => 5.1
[2] => 5.2
[3] => 5.3
)
[urls] => Array
(
[svn] => http://svn.php.net
[git] => http://git.php.net
)
)
)
Example #3 parse_ini_file() parsing a php.ini file
<?php위 예제의 출력 예시: (parsed) magic_quotes_gpc = Yes (loaded) magic_quotes_gpc = Yes 주의
|