No Hope 212 No Hope 212 - 2 months ago 15
PHP Question

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\wamp\www\xml.php on line 42

I've try to write a xml to make a playlist for jwplayer 6, but I can't figure it out where I mistake. Please help :(

// xml
header("Content-Type: text/xml; charset=utf-8");
$xml = "<rss version='2.0' xmlns:jwplayer='http://rss.jwpcdn.com/'><channel><item>";
$xml .= "<title>".$play[0][0]."</title><description></description><jwplayer:image></jwplayer:image><jwplayer:source file=".$provider.$code"/></item>";
$xml .= "</channel></rss>";
echo $xml;
exit();

Answer

You're missing a period after the $code variable.

So change this:

$provider . $code"/></item>";

to this:

$provider . $code . "/></item>";