0
에 따옴표를 처리하는 데 실패 : 브라우저 모두와 견적을 포함PHP DOMDocument를 내가 그와 같은 URL을 열려고 할 때 URL
이http://api.anghami.com/rest/v1/GETsearch.view?sid=11754134061397734622103190992&query=Can't Remember to Forget You Shakira&searchtype=SONG&ook&songCount=1
잘 작동하고 출력은 XML
좋은입니다 나는 PHP 파일에서 호출하려고 할 때 :
'Warning: DOMDocument::load(): I/O warning : failed to load external entity /var/www/html/http:/api.anghami.com/rest/v1/GETsearch.view?sid=11754134061397734622103190992&query=Can't Remember to Forget You Shakira&searchtype=SONG&ook&songCount=1" in /var/www/html/search.php on line 93'
:
$url = "http:/api.anghami.com/rest/v1/GETsearch.view?sid=11754134061397734622103190992&query=Can't Remember to Forget You Shakira&searchtype=SONG&ook&songCount=1"
//using DOMDocument for parsing.
$data = new DOMDocument();
// loading the xml from Anghami API.
if($data->load("$url")){// Getting the Tag song.
foreach ($data->getElementsByTagName('song') as $searchNode)
{
$count++;
$n++;
//Getting the information of Anghami Song from the XML file.
$valueID = $searchNode->getAttribute('id');
$titleAnghami = $searchNode->getAttribute('title');
$album = $searchNode->getAttribute('album');
$albumID = $searchNode->getAttribute('albumID');
$artistAnghami = $searchNode->getAttribute('artist');
$track = $searchNode->getAttribute('track');
$year = $searchNode->getAttribute('year');
$coverArt = $searchNode->getAttribute('coverArt');
$ArtistArt = $searchNode->getAttribute('ArtistArt');
$size = $searchNode->getAttribute('size');
}
}
나는이 오류
아무도 도와 줄 수 있습니까?
'$ url'의'http : /'대신'http : //' – Fracsi
다음 url로 시도하십시오 :'http://api.anghami.com/rest/v1/GETsearch.view?sid=11754134061397734622103190992&query= % 27 % 20 % 20 % 20 % 20 % 20 % 20 % 20 % 20 % 할인 20 % 할인 20 % 할인 20 % 할인 & SONAC & OOK & SongCount = 1' –
URL은 http : // ... 문제가되지 않습니다. –