首页 > 解决方案 > $html_string 中的高级 URL

问题描述

好的,所以现在我有这个 URL,它工作得很好:

$html_string = file_get_contents('https://www.123.com/' . $_GET["ticket"]);

我想要做的是在 URL 之间插入 $_GET 。

这就是我的意思:

('https://www.123.com/' . $_GET["ticket"] /url-continues-here);

我已经尝试了一切,但找不到任何解决方案如何在没有错误的情况下做到这一点。

标签: phpxpathget

解决方案


首先连接两个字符串,然后使用file_get_contents()

$html_string = 'https://www.123.com/' . $_GET["ticket"] . '/url-continues-here';
file_get_content($html_string);

推荐阅读