Jump to content

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>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.