Hi all!
This is probably fairly simple for someone who is used to dealing with arrays. I have an array of data(Parsed from an XML document) containing a string I would like to further split into another array.
The string is along the lines of:
"<name>":<value>,"ID":20251,"ID2":2300,"ID3":2000
How can I split the above into:
Array[<NAME>] => <VALUE>
Notes:
<name> changes often. depending on the query, it may have different <name> values.
I have been trying to do it with preg_split and got to:
Array ( [0] => "<NAME>":<VALUE> [1] => "ID":20251)
but I need to split it further at ":". I tried a foreach, but I failed miserably.
Can anyone point me in the direction of better practice for arrays/preg_split? I have looked into the PHP documentation, but it is not enough for me.
Thanks in advance