php - Variable keeps being mistaken for a boolean when it should be an object -


I keep an issue where one of my variables, $ xml, is living incorrectly for boolean when it The object must return.

I tried to change the $ xml $ data ... thinking it was a naming problem.

I have also tried to isolate the str () function, but it is being recognized as string - which is correct.

I have also tried to use gettype (simplexml_load_string (str ()), which also gives a bull.

Please tell me what I can do wrong:

  function str () {if (file_exists (__dir__./../ '. $ ClientXML)) {file_get_contents (__DIR__.' /../ '$ ClientXML);} and {Return file_gate_content (__DIR__. '/../xml-skeleton.xml');}} $ xml = simplexml_load_string (str ()); Echo is' XML: Gettype ($ xml);  < /x> 

simplexml_load_string goes wrong if I can not parse the TS XML string. You can check the error from:

  & lt; php libxml_use_internal_errors (true); $ Sxe = simplexml_load_string ("& lt ;? Xml version = '1.0' & gt; & lt; broken & Gt; & lt; xml & gt; & lt; / broken & gt; "); if ($ sxe === incorrect) {echo" Failed to load XML "; Foreach (libxml_get_errors () $ as error } {Echo "\ t", $ error-> messages;}}?  

It is taken from here:


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -