【发布时间】:2011-12-26 08:34:58
【问题描述】:
不推荐使用:通过引用分配 new 的返回值是 在 C:\Workspace\htdocs\feedBlurb\processing\simplepie.inc 中已弃用 在第 738 行
这是我在服务器上运行以下 SimplePie 代码时遇到的错误:
<?php
require_once("processing/simplepie.inc");
$feed = new SimplePie();
$feed->set_feed_url(array('http://feeds2.feedburner.com/CssTricks', 'http://smashingmagazine.com'));
$feed->enable_cache(true);
$feed->set_cache_location('core/cache');
$feed->set_cache_duration(1800);
$feed->init();
$feed->handle_content_type();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset='UTF-8'>
<title>Feedblurb</title>
</head>
<body>
<div id="content">
<h1>Feedblurb</h1>
<?php if($feed->error): ?>
<span id='error'><?php echo $feed->error; ?></span>
<?php endif; ?>
<?php foreach($feed->get_items() as $item): ?>
<?php endforeach; ?>
</div>
</body>
</html>
似乎 SimplePie 的所有实例似乎都无法在我的服务器上运行。但我有一个运行 SimplePie 的 WordPress 博客,它似乎运行良好。我的开发服务器正在运行最新版本的 XAMPP。有什么想法吗?
【问题讨论】:
-
删除第 738 行的 & 符号
&
标签: php