What has been found when using the script is that simplexml_load_file() will remove any HTML formating inside the XML file, and will also only load so many layers deep. If your XML file is to deap, it will return a boolean false.
![]() | simplexml_load_fileDescriptionobject simplexml_load_file ( string filename [, string class_name [, int options]] )This function will convert the well-formed XML document in the file specified by filename to an object of class SimpleXMLElement. If any errors occur during file access or interpretation, the function returns FALSE. You may use the optional class_name parameter so that simplexml_load_file() will return an object of the specified class. That class should extend the SimpleXMLElement class. Since PHP 5.1.0 and Libxml 2.6.0, you may also use the options parameter to specify additional Libxml parameters.
See also: simplexml_load_string() ![]()
Anonymous
07-Apr-2006 12:21
What has been found when using the script is that simplexml_load_file() will remove any HTML formating inside the XML file, and will also only load so many layers deep. If your XML file is to deap, it will return a boolean false.
fdouteaud at gmail dot com
09-Mar-2006 09:21
Be careful if you are using simplexml data directly to feed your MySQL database using MYSQLi and bind parameters.
info at evasion dot cc
07-Feb-2006 12:26
Sorry there's a mistake in the previous function :
Bart Verkoeijen
06-Feb-2006 01:30
No problems at all with CDATA:
skutter at imprecision dot net
04-Feb-2006 01:11
So it seems SimpleXML doesn't support CDATA... I bashed together this little regex function to sort out the CDATA before trying to parse XML with the likes of simplexml_load_file / simplexml_load_string. Hope it might help somebody and would be very interested to hear of better solutions. (Other than *not* using SimpleXML of course! ;)
info at evasion dot cc
03-Feb-2006 07:37
Suppose you have loaded a XML file into $simpleXML_obj.
patrick at procurios dot nl
12-Jan-2006 10:46
simplexml_load_file creates an xml-tree with values that are UTF-8 strings. To convert them to the more common encoding
genialbrainmachine at NOSPAM dot tiscali dot it
30-Sep-2005 11:52
Micro$oft Word uses non-standard characters and they create problems in using simplexml_load_file.
mark
13-Sep-2005 02:06
If the property of an object is empty the array is not created. Here is a version object2array that transfers properly.
joelfielder at hotmail dot com
19-Jul-2005 11:01
In the object2array function posted above, the following data structure would be left unchanged:
pa ul at sant a soft dot co m
12-Jul-2005 10:34
One thing to note about the object2array function from aleshru below... this function doesn't handle CDATA fields (e.g. a poorly formed HTML formatted message.) It just returns an empty array.
aleshru at gmail dot com
28-May-2005 03:16
I've got function to convert SimpleXmlObject's to array. | ![]() |