Exclude current post from an array of posts?

Use array_diff() to remove the current post ID from an array of other post IDs.

$include = array( 17, 111, 108, 158);
$include = array_diff( $include, array( $post->ID ) );
$args = array( 'post__in' => $include );
$posts = new WP_Query( $args );

Edit to include a point raised by Pieter Goosen–If $include is not a hard-coded array of IDs but something that comes from the database, you should verify that it is not empty() prior to performing the query. Passing an empty array to 'post__in' will get an unfiltered list of posts, rather than returning no posts as you might expect.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)