Home  >  Article  >  php教程  >  php get_cfg_var 取得 PHP 的配置

php get_cfg_var 取得 PHP 的配置

WBOY
WBOYOriginal
2016-06-13 10:03:331348browse

取得 php教程 的配置选项值。

语法: string get_cfg_var(string varname);

返回值: 字符串

函数种类: php 系统功能
内容说明

若正确取得目前 php 配置选项 varname,则返回变量值。失败则返回 false。

 

*/
echo "php设置的最大执行时间为:n";
print_r(get_cfg_var("max_execution_time"));       //获得配置项的值
echo "
n";
echo "php设置的每个脚本的可使用内存总量为:n";
print_r(get_cfg_var("memory_limit"));         //获得配置项的值
echo "
n";
echo "php设置的接受post的最大大小为:n";
print_r(get_cfg_var("post_max_size"));        //获得配置项的值
echo "
n";
echo "php设置smtp服务器名为:n";
print_r(get_cfg_var("smtp"));          //获得配置项的值
echo "
n";
echo "php设置的上传文件的最大大小为:n";
print_r(get_cfg_var("upload_max_filesize"));       //获得配置项的值
echo "
n";

Statement:
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