Joined May 2012
·

Jason Oakley

JasonTheDev
·
Riverside, CA
·
·
·

Yes, you can type cast a single object or array. The point here is to do it recursively over a large array/object set.

Personally, I prefer to work with objects so this comes in handy to convert a multidimensional array into a series of parent/child objects. I have also run across instances of receiving large object sets where it makes more sense to work with arrays. That's where this comes in handy.

Whoops. I should have probably included that this applies to mixed multidimensional arrays and objects. Type casting would only work at the top level and not apply to the children.

** I edited the tip to reflect that I originally intended.

Achievements
349 Karma
23,801 Total ProTip Views