나는 PHP 프로그래밍의 초보자입니다. 나는 시도하고 지속적으로 아래의이 독특한 파일의 내용을 가져 오는 데 실패했습니다 :PHP가 원격 파일의 내용을 읽을 수 없습니다.
http://nghenhacvang.net/playplaylist/5730.xml
API get_file_contents
를 사용하여. 사용자 에이전트를 설정하지 않고 작동하지 않습니다 file_get_contents()
보인다
Remote Address:23.226.231.225:80
Request URL:http://nghenhacvang.net/playplaylist/5730.xml
Request Method:GET
Status Code:200 OK
Request Headersview source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding:gzip, deflate, sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Cookie:PHPSESSID=2g8id3hevm0sqo3qv8ln8n04h2; __utma=107959197.1514810948.1417822471.1417840071.1417854776.3; __utmc=107959197; __utmz=107959197.1417822471.1.1.utmcsr=search.pch.com|utmccn=(referral)|utmcmd=referral|utmcct=/search
Host:nghenhacvang.net
User-Agent:Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36
Response Headersview source
Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection:Keep-Alive
Content-Encoding:gzip
Content-Length:660
Content-Type:text/xml
Date:Sat, 06 Dec 2014 10:32:55 GMT
Expires:Thu, 19 Nov 1981 08:52:00 GMT
Keep-Alive:timeout=15, max=100
Pragma:no-cache
Server:Apache/2.2.3 (CentOS)
Set-Cookie:SID=0a2f9b6ce1d6280ca5fa74e118a2e1b6; expires=Thu, 01-Jan-1970 01:00:00 GMT
Vary:Accept-Encoding,User-Agent
X-Powered-By:PHP/5.1.6
실패 했습니까? 방법? PHP 코드를 여기에 게시하십시오. –
Indra 저는 Ghost가 옵션/컨텍스트 부분을 제외하고 정확히 구현하고 빈 문자열을 돌려받습니다. – RC2