php file_get_contents and &

后端 未结 7 2132
误落风尘
误落风尘 2020-12-07 00:48

I\'m trying to use php\'s file_get_content(\'a url\');

The thing is if the url has \'&\' in it, for example

file_get_contents(\'http://www.google.c

相关标签:
7条回答
  • 2020-12-07 01:12

    Try replace simple quote ' for double quote ":

    file_get_contents("http://www.google.com/?var1=1&var2=2")

    it seems odd, but works!

    0 讨论(0)
提交回复
热议问题