This is easy to do:
$query = "SELECT * FROM table_name WHERE user_id IN('1','2','3')";
Since your value is in an array, you can use:
$users = array('1', '2', '3'); $user_id = "'" . implode("', '", $users ) . "'"; $query = "SELECT * FROM table_name WHERE user_id IN($user_id)";
Hope this helps.
source share