How can I determine if something is an array or an object in PHP?

What is the best way to determine if something is an array or an object in PHP? I get a response from a web service and it's either an array or an object depending on how many returned results there are. It is impossible to predict ahead of time how many there will be, so I need to figure out how to process it appropriately. What is the best way to do this?

TIA.

13.10.2009 22:53:18
4 ОТВЕТА
РЕШЕНИЕ
7
13.10.2009 22:55:18
Well played. JFGI fail on my part. Thanks.
benjy 13.10.2009 22:56:15

Take a look at the is_object and is_array PHP functions.

8
13.10.2009 22:55:59

Try this:

is_array ($var)
1
13.10.2009 22:56:14
1
13.10.2009 22:56:50