0

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..

2
  • xml script...? what is that ? I suggest you gives details of what you want to achieve. Commented Jun 15, 2010 at 10:37
  • I guess it was just a rude form of spam. Commented Jun 15, 2010 at 10:39

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.