1
I intend to join in a array the values of a checkbox but how string and so that they are separated by array('string1','string2')
, to be able to use in a mysql query IN('string1','string2')
.
These values come from a checkbox to a session:
$variavel= $_SESSION['checkbox'] = implode(',',$_POST['checkbox']);
In this way, it separates only the values with ,
, array(int1,int2)
, but when I put together a value string he makes a mistake.
How can I add ' to each value in the array to look like this array('string1','string2')
?