PHP- merge two xml attribute withou duplicated

motoxer311

New Member
I have two xmls like thisxml1: \[code\] <Title>Sea Change</Title> <thirdParty_ID></thirdParty_ID> <Animation_Indicator>N</Animation_Indicator> <Blackout_Indicator>N</Blackout_Indicator><SD_Purchase_Zoe></SD_Purchase_Zoe> <SD_Purchase_Window_Start_Zoe></SD_Purchase_Window_Start_Zoe> <SD_Purchase_Window_End_Zoe></SD_Purchase_Window_End_Zoe> <SD_Licensing_Window_start_Zoe></SD_Licensing_Window_start_Zoe><HD_Licensing_Window_start_Zoe>2012-04-01</HD_Licensing_Window_start_Zoe> <HD_Licensing_Window_end_Zoe>2013-04-01</HD_Licensing_Window_end_Zoe> <HD_Purchase_Window_Start_Zoe>2012-04-01</HD_Purchase_Window_Start_Zoe>\[/code\]xml2:\[code\]<Asset_Record> <Title>Sea Change</Title> <thirdParty_ID></thirdParty_ID> <Animation_Indicator>N</Animation_Indicator> <Blackout_Indicator>N</Blackout_Indicator><SD_Purchase_Zoe>Y</SD_Purchase_Zoe> <SD_Purchase_Window_Start_Zoe>2012-04-01</SD_Purchase_Window_Start_Zoe> <SD_Purchase_Window_End_Zoe>2013-04-01</SD_Purchase_Window_End_Zoe> <SD_Licensing_Window_start_Zoe>2012-04-01</SD_Licensing_Window_start_Zoe><HD_Licensing_Window_start_Zoe></HD_Licensing_Window_start_Zoe> <HD_Licensing_Window_end_Zoe></HD_Licensing_Window_end_Zoe> <HD_Purchase_Window_Start_Zoe></HD_Purchase_Window_Start_Zoe>\[/code\]I would like to merge xml1 and xml2 and output like\[code\]<Title>Sea Change</Title> <thirdParty_ID></thirdParty_ID> <Animation_Indicator>N</Animation_Indicator> <Blackout_Indicator>N</Blackout_Indicator><SD_Purchase_Zoe>Y</SD_Purchase_Zoe> <SD_Purchase_Window_Start_Zoe>2012-04-01</SD_Purchase_Window_Start_Zoe> <SD_Purchase_Window_End_Zoe>2013-04-01</SD_Purchase_Window_End_Zoe> <SD_Licensing_Window_start_Zoe>2012-04-01</SD_Licensing_Window_start_Zoe> <SD_Licensing_Window_start_Zoe></SD_Licensing_Window_start_Zoe><HD_Licensing_Window_start_Zoe>2012-04-01</HD_Licensing_Window_start_Zoe> <HD_Licensing_Window_end_Zoe>2013-04-01</HD_Licensing_Window_end_Zoe> <HD_Purchase_Window_Start_Zoe>2012-04-01</HD_Purchase_Window_Start_Zoe>\[/code\]First I need to check are these two xmls have the same titles, if they have the same titles and merge them, and merge all the values if it is possible to find from any of them.Thanks for reply.
 
Back
Top