PHP 更改了file_get_contents参数 url


PHP changes the file_get_contents param url

我使用以下行来获取页面内容:

$handle = file_get_contents(
    "http://www.mywebsite.com/index.php?show=users&action=msg&section=send", 
    NULL, 
    NULL, 
    1000, 
    19000);

然后,我收到以下消息:

警告: file_get_contents(http://www.mywebsite.com/index.php?show=users&action=msg §ion=发送): 无法打开流:HTTP 请求失败!HTTP/1.0 403 禁止

(请在粗体部分注明)。

怎么了?为什么它会更改网址参数?

我不认为PHP正在更改查询字符串参数。

如果您在浏览器中阅读该消息,则应该只是输出如何格式化HTML的问题。因此,您收到的403错误不应与某些不需要的URL转换有关。