4

Possible Duplicate:
Iterable objects and array type hinting?

I am passing a JSON'd feed from Twitter into my application, and sometimes Twitters API returns empty or incomplete feeds. This is causing a problem when I try to iterate the feeds using foreach - does anyone know of a suitable test to find out if an object or array is iterable?

Could this be done with isarray($obj) || $obj instanceof Iterator or are there any other cases I should look out for?

Community
  • 1
  • 1
Kevin Sedgley
  • 1,049
  • 1
  • 11
  • 22
  • 3
    See NullUserException's answer to [this question](http://stackoverflow.com/questions/3584700/iterable-objects-and-array-type-hinting) – BoltClock Oct 22 '10 at 13:09
  • Answered here: http://stackoverflow.com/questions/3584700/iterable-objects-and-array-type-hinting/3584781#3584781 Credit to boltclock – Kevin Sedgley Oct 22 '10 at 16:14

0 Answers0