$string = "'1', '2', '3'";
$string = str_replace("'", '', $string);
$sql = "SELECT * FROM name WHERE id NOT IN ( " . implode(",", explode(',',$string)) . ") LIMIT 10 ";
echo $sql;
var str = "Rose,Lotus,Sunflower,Marogold,Tulip,Jasmine";
var arr = str.split(',');
console.log(arr);
// Output: ["Rose", "Lotus", "Sunflower", "Marogold", "Tulip", "Jasmine"]
SELECT * FROM name WHERE id NOT IN ( 1, 2, 3) LIMIT 10
$string = "'1', '2', '3'";
$string = str_replace("'", '', $string);
$sql = "SELECT * FROM name WHERE id NOT IN ( $string ) LIMIT 10 ";