Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/263.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转换链接问题_Php - Fatal编程技术网

PHP转换链接问题

PHP转换链接问题,php,Php,如何使用PHP$\u服务器或类似工具转换下面的链接 '../members/' . urlencode($user_id) . '/images/thumbs/' . $avatar; 你的问题有点不清楚,但我想这可能就是你想要的 $\u服务器['REQUEST\u URI'] 这将给你的一切在url后的域名 如果你要求的话 这将返回/sites/test/one.html 如果我理解,您需要完整的URL: $myUrl = $_SERVER['SERVER_NAME'] . '/member

如何使用PHP$\u服务器或类似工具转换下面的链接

'../members/' . urlencode($user_id) . '/images/thumbs/' . $avatar;

你的问题有点不清楚,但我想这可能就是你想要的

$\u服务器['REQUEST\u URI']

这将给你的一切在url后的域名

如果你要求的话

这将返回/sites/test/one.html


如果我理解,您需要完整的URL:

$myUrl = $_SERVER['SERVER_NAME'] . '/members/' . urlencode($user_id) . '/images/thumbs/' . $avatar;

echo "<a href='" . $myUrl . "'>" . $myUrl . "</a>";

从何处获取哪个URL?在哪一点上?我不明白。第二,佩卡的想法,我们需要更多的信息。我的意思是说图像链接。@Ghommey no not echo我想转换链接没有链接。改成什么?$\u服务器与此有什么关系?