-4

I have an object that I need to convert to an array, how can I do this?

    Array
    (
        [0] => stdClass Object
            (
              ...
NaN
  • 1,286
  • 2
  • 16
  • 29
  • Not just a dupe, a SUPER dupe, identical question found here: http://stackoverflow.com/questions/2476876/how-do-i-convert-an-object-to-an-array – Eric Leschinski Sep 08 '13 at 04:11
  • You missed your calling... you should have been a cop. – NaN Sep 08 '13 at 04:23
  • 1
    you should really do some research before asking basic questions, which already have good answers. Typing your question title into google actually brings up the result that @EricLeschinski pointed you to. There are 4 answers to that question. One of which has 78 upvotes. – Drew Khoury Sep 08 '13 at 04:29

1 Answers1

4

Cast your object to an array:

$array[0] = (array) $array[0];

This is obviously not taking into account any more details than what you posted :P

Joseph Silber
  • 214,931
  • 59
  • 362
  • 292