Jump to content

Recommended Posts

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?

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.