allow_url_fopen = Off 일때 simplexml_load_file 사용
페이지 정보
본문
if(ini_get('allow_url_fopen')) {
$xml = simpleXML_load_file($url);
}else{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$xml_raw = curl_exec($ch);
$xml = simplexml_load_string($xml_raw);
}
관련자료
등록된 댓글이 없습니다.