开发者

PHP open_basedir - to return value?

开发者 https://www.devze.com 2022-12-29 00:30 出处:网络
I want to return the value of open_basedir in a php script.. how can I d开发者_运维知识库o it?

I want to return the value of open_basedir in a php script.. how can I d开发者_运维知识库o it? If value is blank it should echo that is blank..

Thanks!


open_basedir is a setting that's configured in php.ini

So, you can get its current value with ini_get :

echo ini_get('open_basedir');


For example, if open_basedir is defined this way in my php.ini file :

open_basedir = /data/www:/var/www:/home/squale/developpement/tests

Then, the following portion of code :

var_dump(ini_get('open_basedir'));

Gets me this output :

string '/data/www:/var/www:/home/squale/developpement/tests' (length=51)
0

精彩评论

暂无评论...
验证码 换一张
取 消