How to check if the postID is in an array? [closed]

As Sally highlights, you can use in_array() like this (untested):

// target ids
$ids = array(123, 321, 213);

if (!empty($post->ID) && is_numeric($post->ID) && in_array((int)$post->ID, $ids)) {
   // do jazz
} else {
   // do stuff
}

techhipbettruvabetnorabahisbahis forumuedusedueduedueduseduseduseduseduedus