2012-06-26 2 views
-3

PHP를 사용하여 블로거 XML 피드를 만드는 방법은 무엇입니까? 나는 당신의 질문을 이해 한 경우PHP를 사용하여 블로거 XML 피드를 만드는 방법은 무엇입니까?

 
<?xml version='1.0' encoding='UTF-8'?><ns0:feed xmlns:ns0="http://www.w3.org/2005/Atom"><ns0:generator>Blogger</ns0:generator><ns0:entry><ns0:category scheme="http://www.blogger.com/atom/ns#" term="$category" /><br/><ns0:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/blogger/2008/kind#post" /><ns0:id>$postid</ns0:id><ns0:content type="html">$content</ns0:content><ns0:published>$published</ns0:published><ns0:title type="html">$title</ns0:title></ns0:entry></ns0:feed>

답변

0

, 내 대답은 희망이 당신에게

$slideshow [] = array('item' => $new[$j], 'source' => $x,'zoom' => $y); 

    $doc = new DOMDocument(); 
    $doc->formatOutput = true; 

    $r = $doc->createElement("slideshow"); 
    $doc->appendChild($r); 

    foreach($slideshow as $item) 
    { 
    $b = $doc->createElement("item"); 

    $source = $doc->createElement("source"); 
    $source->appendChild(
    $doc->createTextNode($item['source']) 
); 
    $b->appendChild($source); 

    $zoom = $doc->createElement("zoom"); 
    $zoom->appendChild(
    $doc->createTextNode($item['zoom']) 
); 
    $b->appendChild($zoom); 

    $r->appendChild($b); 

    } 
    echo $doc->saveXML(); 
    $doc->save("abc.xml") 
을하는 데 도움이
관련 문제