开发者

How can i assign xml scripts in to a php variable?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜