Jump to content

Merge SimpleXML Arrays


rossmurphy

Recommended Posts

I have these two simple XML elements, they both contain the same attributes. I need to merge them into a single xmlobject. Is this possible?

 

SimpleXMLElement Object ( [@attributes] => Array ( [configId] => 9 [denominations] => 0.05, 0.25, 0.5, [gameCurrency] => GBP [gameName] => 7s Ablaze (5 Line) [gameSource] => parlay [gameType] => SL [maxBet] => 0.5 [maxCoins] => 0 [minBet] => 0.05 [minCoins] => 1 [screenName] => 7s Ablaze (5 Line) [style] => BLA5 ) )

SimpleXMLElement Object ( [@attributes] => Array ( [configId] => 1 [denominations] => null [gameCurrency] => GBP [gameName] => MonsterCarlo [gameSource] => Orbis [gameType] => MC [maxBet] => 0.0 [maxCoins] => 0 [minBet] => 0.0 [minCoins] => 0 [screenName] => Monster Carlo [style] => ORBIS ) ) 

Link to comment
https://forums.phpfreaks.com/topic/168683-merge-simplexml-arrays/
Share on other sites

<rows>
<row balance="208.13" bonus="0.0" cash="208.13" currency="GBP"/>
</rows>

 

<rows>
<row balance="100.50" bonus="1.0" cash="999.59" currency="EUR"/>
</rows>

 

I want to combine these so they look like this:

 

<rows>
<row balance="208.13" bonus="0.0" cash="208.13" currency="GBP"/>
<row balance="100.50" bonus="1.0" cash="999.59" currency="EUR"/>
</rows>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.