$PHP_SELF=$_SERVER['PHP_SELF'];
#$path_url="http://".$_SERVER['SERVER_NAME'];//获取域名如 www.hgj123.ss.ma
$path_url='http://'.$_SERVER['HTTP_HOST'].substr($PHP_SELF,0,strrpos($PHP_SELF,'/')+1);
$url_img=$path_url."/wx_chat/img/";
转载于:https://www.cnblogs.com/hgj123/p/4564459.html