XML: Cannot load even when string is escaped



I have big problem, I cant load XML file even when every special char is escaped. My XML:



<code1>
<code>&lt;?php
// create curl resource
$ch = curl_init();

// set url
curl_setopt($ch, CURLOPT_URL, &quot;example.com&quot;);

//return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// $output contains the output string
$output = curl_exec($ch);

// close curl resource to free up system resources
curl_close($ch);
?&gt;</code>
</code1>


When I insert in <code></code> another string, ex. Hello world, it works. Why it doesnt work? BTW, I am using PHP's simplexml_load_file. Thank you.


No comments:

Post a Comment