wordpress newsfeed(RSS) 취득하기


wordpress newsfeed(RSS) 취득하기

업무노트 wordpress newsfeed(RSS) 취득하기 당근먹는개냥이 2016. 7. 14. 14:12 이웃추가 본문 기타 기능 워드프레스의 RSS을 가져올때는 simplexml_load_file()을 이용하면 간단히 해결할 수 있다. 예를 들어 XML을 구조가 아래와 같은 경우
xml version="1.0" encoding="UTF-8"?> ... ...

... 대략 아래와 같이 사용 가능
$strArrXml = simplexml_load_file('http://example.co.jp/feed/'); // item의 갯수취득 $nCnt = count($strArrXml->channel->item); for ($i = 0; $i < $nCnt; $i++) { // EUC-KR로 인코딩하되 IGNORE옵션으로 특수한 문자로 인한 글자...


#newsfeed #RSS #wordpress #XML

원문링크 : wordpress newsfeed(RSS) 취득하기