How to use in_array if the array contain only one element?
I loop through a big array and got a small array of ids

    foreach ($cats as $cat)
    	$cat_ids[] = $cat->term_id;

sometimes the $cat_ids has only one element. `Array ( [0] => 123` )

When I check if a random id is in this $cat_ids array, `if( in_array( $int,$cats_ids ))`

I may get error message of $cat_ids "in_array() expects parameter 2 to be array,..."

How can I check if $int is in $cat_ids properly? 
How to use in_array if the array contain only one element?
===

I loop through a big array and got a small array of ids

    foreach ($cats as $cat)
    	$cat_ids[] = $cat->term_id;

sometimes the $cat_ids has only one element. `Array ( [0] => 123` )

When I check if a random id is in this $cat_ids array, `if( in_array( $int,$cats_ids ))`

I may get error message of $cat_ids "in_array() expects parameter 2 to be array,..."

How can I check if $int is in $cat_ids properly? 