xml-parser icon indicating copy to clipboard operation
xml-parser copied to clipboard

arrayToObject method

Open nimasdj opened this issue 10 years ago • 2 comments

@jtrumbull As discussed in #1 and #5 I will open a new issue separately.

I see objectToArray is already available, so it is possible to have input as both array and object. It would be good to add arrayToObject, to allow us to have output as both array and object, if we need the returned decoded result as object instead of array, consider this please?

nimasdj avatar Aug 04 '15 05:08 nimasdj

@jtrumbull I tested it and noticed decoder output is a stdObject already, but what if I want the output as a normal array? Is there an option to switch the output between stdObject and normal array? Or it can just return the output as json, user can decode json as array or object himself. Isn't it better?

nimasdj avatar Aug 04 '15 05:08 nimasdj

@jtrumbull I created pull request #10 to support this all. I hope you consider to merge it as many people will appreciate decoder this way.

nimasdj avatar Aug 06 '15 09:08 nimasdj