-1
我在嘗試將tumblr訂閱源鏈接到網站。我發現這個代碼(正如你所看到的東西也必須隨之被打破,因爲它在這個崗位正確甚而不格式):這個XML/PHP代碼爲Tumblr網站有什麼問題嗎?
<?php
$request_url = 「http://thewalkingtree.tumblr.com/api/read?type=post&start=0&num=1」;
$xml = simplexml_load_file($request_url);
$title = $xml->posts->post->{‘regular-title’};
$post = $xml->posts->post->{‘regular-body’};
$link = $xml->posts->post[‘url’];
$small_post = substr($post,0,320);
echo ‘<h1>’.$title.’</h1>’;
echo ‘<p>’.$small_post.’</p>’;
echo 「…」;
echo 「</br><a target=frame2 href=’」.$link.」’>Read More</a>」;
?>
And i inserted the tumblr link that I will be using. When I try to preview my HTML, i get a bunch of messed up code that reads as follows:
posts->post->{'regular-title'}; $post = $xml->posts->post->{'regular-body'}; $link = $xml->posts->post['url']; $small_post = substr($post,0,320); echo '
'.$title.'
'; echo '
'.$small_post.'
'; echo "…"; echo "Read More"; ?>
任何幫助,將不勝感激。謝謝!
什麼不起作用? – justkt 2011-04-27 19:14:18