图片上传时获取路径神器

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/../../../../'))."/");

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");    //这样是获取当前文件的磁盘路径

(__FILE__)后面的../根据你需求加../

猜你喜欢

转载自blog.csdn.net/weixin_40896800/article/details/82221976