1-- SQL
2SELECT * FROM table WHERE column IN('value1','value2','value3')
3
4-- Javascript
5$string="1,2,3,4,5";
6$array=array_map('intval', explode(',', $string));
7$array = implode("','",$array);
8$query=mysqli_query($conn, "SELECT name FROM users WHERE id IN ('".$array."')");
1$sql = 'SELECT *
2 FROM `table`
3 WHERE `id` IN (' . implode(',', array_map('intval', $array)) . ')';