Created
July 11, 2017 05:30
-
-
Save suconghou/e0bb202cdb8344105a4287e8eca8d12e to your computer and use it in GitHub Desktop.
fetch domain resource use given host
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$opts = stream_context_create(array( | |
'http'=> array( | |
'method' => 'GET', | |
'header'=> "Host: www.oschina.net\r\nUser-Agent: my file_get_contents use host\r\n", | |
) | |
)); | |
$url = "http://125.39.6.163/news/86646/lftp-4-8-0"; | |
echo file_get_contents($url, null, $opts); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment