Parse error: syntax error, unexpected ';', expecting ')' in /home/nielsender/domains/uniting-gamers.com/public_html/rss/news.php on line 10
Dit is mijn code:
<?php
require_once '/home/nielsender/domains/uniting-gamers.com/private_html/config.php';
ini_set( 'display_errors', 1 );
error_reporting( E_ALL | E_STRICT );
date_default_timezone_set( 'Europe/Amsterdam' );
$newsItems =
array
( ?>
<?php
$result = mysql_query("SELECT DISTINCT * FROM news ORDER BY date DESC LIMIT 10");
while($row = mysql_fetch_array($result)){
$title = $row['title'];
$description = $row['description'];
echo "array
(
'title' => '$title',
'description' => '$description',
'datetime' => ''
),"; }
);
$xmlNamespace = '<?xml version="1.0" encoding="utf-8"?>';
$xml = new SimpleXMLElement( $xmlNamespace . '<rss/>' );
$xml->addAttribute( 'version', '2.0' );
$channelNode = $xml->addChild( 'channel' );
$channelNode->addChild( 'title', 'Uniting-Gamers.nl News' );
$channelNode->addChild( 'link', 'http://www.uniting-gamers.com/');
$channelNode->addChild( 'description', 'Het laatste nieuws van Uniting-Gamers.com' );
$channelNode->addChild( 'pubDate', date( 'r' ) );
$channelNode->addChild( 'copyright', '(c) copyright' );
foreach( $newsItems as $newsItem )
{
$itemNode = $channelNode->addChild( 'item' );
$itemNode->addChild( 'title', $newsItem['title'] );
$itemNode->addChild( 'description', $newsItem['description'] );
$itemNode->addChild( 'pubDate', date( 'r', strtotime( $newsItem['datetime'] ) ) );
}
header( 'Content-Type: application/xml' );
echo $xml->asXML();
?>
Iemand een idee wat ik verkeerd doe?