Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/286.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用PHP&;获取完整URL;包含子域_Php - Fatal编程技术网

使用PHP&;获取完整URL;包含子域

使用PHP&;获取完整URL;包含子域,php,Php,我一直在使用以下内容来发现完整的url,但它没有检测到我从中调用的子域 $current_url = "http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"].""; echo $current_url;EXIT; 任何建议?$\u服务器['HTTP\u主机]应包括子域。你能把我们链接到一个示例页面吗?经过测试,对我来说效果很好。使用此代码: <? $current_url = "http://".$_SERVER["HTTP_HOS

我一直在使用以下内容来发现完整的url,但它没有检测到我从中调用的子域

$current_url = "http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]."";
echo $current_url;EXIT;

任何建议?

$\u服务器['HTTP\u主机]
应包括子域。你能把我们链接到一个示例页面吗?

经过测试,对我来说效果很好。使用此代码:

<?
$current_url = "http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]."";
echo $current_url;EXIT;
?>