Hi All,
After a long absense, I am back to coding. THis time a processing script for an xml database. Part of the processing is reading a xomplex XML file, and getting some 25 fields, to be stored in a database. I am a little confused as to how to get started on this. Ideally I just convert the whole XML in an array and work from there. Besides that fact that I cannot the example files to work, I am sure there must be a better way to do this.
An example of the xml te read: http://www.hodexer.nl/hodex/nhtv/hodex_nl_nhtv_22025.xml
I tried this function to convert the whole lot, but that ignores all text input:
function objectsIntoArray($arrObjData, $arrSkipIndices = array())
{
$arrData = array();
// if input is object, convert into array
if (is_object($arrObjData)) {
$arrObjData = get_object_vars($arrObjData);
}
if (is_array($arrObjData)) {
foreach ($arrObjData as $index => $value) {
if (is_object($value) || is_array($value)) {
$value = objectsIntoArray($value, $arrSkipIndices); // recursive call
}
if (in_array($index, $arrSkipIndices)) {
continue;
}
$arrData[$index] = $value;
}
}
return $arrData;
}