-3
可一些請幫幫我,想立即解決這個錯誤了幾個小時,不似乎知道如何解析錯誤:解析錯誤,意想不到的T_OBJECT_OPERATOR,預計「)」
解析錯誤:解析錯誤,意想不到的T_OBJECT_OPERATOR,預計 ')'
oreach ($doc->getElementsByTagName('item') as $node) {
if ($counter <= $limit)
{
$items = array ('title' => $node->getElementsByTagName('title')->item(0)->nodeValue,'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,'description' => $node->getElementsByTagName('description')->item(0)->nodeValue,'pubDate' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue);
array_push($feeds, $items);
}
$counter++;
}
echo '
<ul id="facebook">';
foreach ($feeds as $feed)
{
$date = strtotime($feed['pubDate']);
echo '
<li>';
echo '<div class="blog_box">
<div class="grid_2">
<h4>'. date('jS F Y G:H' ,$date) .'</h4>
</div>
<div class="grid_6">
<h1><a href="'. $feed['link'] .'" title="'.$feed['title'].'">'.$feed['title'].'</a></h1>
<p>'.$feed['description'].'</p>
</div>
<div align="right">
<a href="'. $feed['link'] .'" class="button minimal small" title="News link">Read More</a>
</div>
<div class="clearnospacing"></div>
</div>
';
echo '</li>
';
}
echo '</ul>
';
,即時通訊得到的是
$items = array ('title' => $node->getElementsByTagName('title')->item(0)->nodeValue,'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,'description' => $node->getElementsByTagName('description')->item(0)->nodeValue,'pubDate' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue);
+1瞭解根源。 –
它可能是php 4,目前的主機是可怕的 - 但不能移動,直到下個月:(,那麼我怎麼稱呼它? – user1761886
我已經更新了我的答案與PHP4兼容的解決方案 – Cal