티스토리 뷰
14년 4월 기준.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
<?
include "XMLparse.php";
//$url = "http://www.zdnet.co.kr/Include2/ZDNetKorea_News.xml";
$url = "z.xml";
/*$curl = curl_init();
$timeout = 5;
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $timeout);*/
//echo curl_exec($curl);
$xml = file_get_contents($url);
//$xml = curl_exec($curl);
$parser = new XMLParser($xml);
$parser->Parse();
$test = $parser->document;
echo "<a href=".$test->channel[0]->item[0]->link[0]->tagData." target='_blank'>"
.$test->channel[0]->item[0]->title[0]->tagData."</a>"."<br>";
echo $test->channel[0]->item[0]->description[0]->tagData."<br>";
echo $test->channel[0]->item[0]->category[0]->tagData."<br>";
echo $test->channel[0]->item[0]->pubDate[0]->tagData."<br>";
echo $test->channel[0]->item[0]->author[0]->tagData."<br>";
?>
</body>
</html>
'Study' 카테고리의 다른 글
Debian(데비안) 관련 (0) | 2024.01.14 |
---|---|
Oracle(오라클) sqlplus(에스큐엘 플러스) error(에러) (0) | 2024.01.14 |
Samsung Notebook BIOS Booting USB Error(삼성 노트북 바이오스 부팅 usb 인식 못하는 경우) (1) | 2024.01.14 |
Java(자바) jackson(잭슨) JSON(제이슨) (0) | 2024.01.14 |
Windows(윈도우) tcping 관련 (0) | 2024.01.14 |