I am trying to convert a String
$string = "'1', '2', '3'";`
to an array
$array = array($string);
By doing so it gives me an error when trying to fetch data on MySQL
SELECT * FROM name WHERE id NOT IN ( '" . implode( "', '" , $array) . "' ) LIMIT 10
However, if I manually set the array as $array = array('1', '2', '3')
it doesn't give an error when fetching a data, is there a way to convert the string to the array so the fetching doesn't give out an error? Because what I am trying to do is some data will be going to be passed to this file, where it will be fetched as a String, but later want to convert it to an array. I also tried removing the quotation mark from the String and it still gives the same error str_replace('"', "", $string);
using this inside of the array.