No Hope 212 No Hope 212 - 1 year ago 189
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=''><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;

Answer Source

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

So change this:

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

to this:

$provider . $code . "/></item>";
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download