I can not assign a xml scripts in to a php variable.
My xml text:
<?xml version="1.0" encoding="UTF-8" ?><rss version="2.0"><channel>
<title>coolajax.net</title>
<link>http://开发者_开发百科www.hotscripts.com/listings/feed</link>
<description>Coolajax Scripts Listings Description</description>
and I want to assign this text in to $xml_header
variable.
can anyone help me..
You can use HEREDOC Syntax for this:
$xml_header = <<< XML
<?xml version="1.0" encoding="UTF-8" ?><rss version="2.0"><channel>
<title>coolajax.net</title>
<link>http://www.hotscripts.com/listings/feed</link>
<description>Coolajax Scripts Listings Description</description>
XML;
Just make sure you start the XML string on the next line at the first position.
精彩评论