tryingtolearn Posted November 9, 2009 Share Posted November 9, 2009 I need a way to add certain parts of an array to certain parts of a simplexml object The array I have is like this Array ( [0] => ../_designer-shoes_AA00_crtZ4ew_qridZ55690714aa_wowsidZp4634322 [1] => ../_Other_AA00_crtZ1ew_qridZ55690714aa_wowsidZp4634322 ) The simplexml object returned is this SimpleXMLElement Object ( [iD] => 7 [Name] => OTHER [Order] => 0 ) SimpleXMLElement Object ( [iD] => 12 [Name] => designer shoes [Order] => 15 ) SimpleXMLElement Object ( [iD] => 546781 [Name] => OUTSIDE PRODUCTS [Order] => 32 ) So now i need to match up the NAME with the link from the array and if it matches add it to the object to end up with this SimpleXMLElement Object ( [iD] => 7 [Name] => OTHER [Order] => 0 [Path] => ../_Other_AA00_crtZ1ew_qridZ55690714aa_wowsidZp4634322 ) SimpleXMLElement Object ( [iD] => 12 [Name] => designer shoes [Order] => 15 [Path] => ../_designer-shoes_AA00_crtZ4ew_qridZ55690714aa_wowsidZp4634322 ) SimpleXMLElement Object ( [iD] => 546781 [Name] => OUTSIDE PRODUCTS [Order] => 32 [Path] => NO PATH ) Is that something that can be done? Link to comment https://forums.phpfreaks.com/topic/180870-solved-add-array-element-to-simplexml-can-it-be-done/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.