cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Extract object from array

NeverTooOldToLe
New Contributor III

Iโ€™ve got an array with one object in it, similar to this:

[ { โ€œpropertyโ€ : โ€œvalueโ€ } ]

Iโ€™d like to remove it from the array and be left with an object:

{ โ€œpropertyโ€ : โ€œvalueโ€ }

Iโ€™ve been playing with the mapper root, but I canโ€™t find a syntax that will do this. Should I be using a different Snap?

1 ACCEPTED SOLUTION

del
Contributor III

You should be able to just use the array index value of [0] to extract the object.
ex. $myArray[0]

View solution in original post

2 REPLIES 2

del
Contributor III

You should be able to just use the array index value of [0] to extract the object.
ex. $myArray[0]

NeverTooOldToLe
New Contributor III

perfect! exactly what i needed.