php - Fooling around with xml -


i have poorly formed xml in php able contents of, problem strips html tags

<content>     <whatshere>     <![cdata[             <h1>content</h1>     ]]>     </whatshere>     <whatscoming>     <![cdata[             <h2>i have no idea</h2>     ]]>     </whatscoming> </content> 

i doing:

class coretheme_adminpanel_template_helper_grabupdatecontent{      private $_xml_object_content = null;      public function __construct(){         if($this->_xml_object_content === null){             $this->_xml_object_content = simplexml_load_file('http://adambalan.com/aisis/aisis_update/test/update_notes.xml');         }     }      public function whats_here(){         $content = $this->_xml_object_content->whatshere[0];         echo $content;         return trim($content);     }  } 

when call whats_here() <p>content</p> instead of <h1>content</h1> should.

it looks this comment in php page simplexml_load_file may apply you, saying:

so seems simplexml doesn't support cdata...


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -