XML parsing conundrum

后端 未结 7 1557
甜味超标
甜味超标 2021-01-15 22:25

UPDATE: I\'ve reworked the question, to show progress I\'ve made, and maybe make it easier to answer.

UPDATE 2: I\'ve added another value to the XML. Extension avail

7条回答
  •  误落风尘
    2021-01-15 22:55

    start by declaring

    $groups[stripslashes($file->Platform)][stripslashes($file->Name)]
      [stripslashes($file->Title)] = (object)array(
        'Name' => $file->Name,
        'Title' => $file->Title,
        'Files' = (object)array()
      );
    

    This will get you closer.

    You should also check the type of each XMLElement as you get it to see if its an array or a simple object. Then treat accordingly.

提交回复
热议问题