tags:

views:

24

answers:

1

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&lt;/link&gt;
    <description>Coolajax Scripts Listings Description</description>

and I want to assign this text in to $xml_header variable.

can anyone help me..

+1  A: 

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&lt;/link&gt;
    <description>Coolajax Scripts Listings Description</description>
XML;

Just make sure you start the XML string on the next line at the first position.

Gordon