使用||递增和if语句

I'm trying to get the if statement to echo inline styles. However I can only get my conditional to return true on any 1 number, not with an array, a || to separate etc...

Can you please explain how to make the || version and an array of numbers return true in my conditional.

// Works.
$counts = 0 ;
foreach ($posts as $post) : setup_postdata($post); $counts++; 
 if ($counts == 8) {echo 'counts equals your numbers';}
endforeach; 

// This does nothing.
$numbers = array(4,8);
$counts = 0 ;
foreach ($posts as $post) : setup_postdata($post); $counts++; 
 if ($counts == $numbers) {echo 'counts equals your numbers';}
endforeach; 

// Returns true for every iteration.
$counts = 0 ;
foreach ($posts as $post) : setup_postdata($post); $counts++; 
 if ($counts == 4 || 8) {echo 'counts equals your numbers';}
endforeach; 

Use PHP's built-in in_array function:

if ( in_array($counts, $numbers) ) {echo 'counts equals your numbers';}

The syntax for || is:

if ($counts == 4 || $counts == 8) {echo 'counts equals your numbers';}