Tiago Sa :
If I implode an array $arr = ["Hello my, name is Steve", "How are you?"]
to string to insert to MySQL database like so: $data = implode(',',$arr);
, when I try to retrieve those values and explode it back into array: $arr2 = explode(',',$data);
it returns : ["Hello my", "name is Steve", "How are you?"]
How do I get it to ignore the comma thats already in between quotes and explode as:
["Hello my, name is Steve", "How are you?"]
Omi in a hellcat :
Instead you can use json_encode and json_decode.
Try this out:
$arr = ["Hello my, name is Steve", "How are you?"]
$data = json_encode($arr); //Insert $data into mysql
//Then to retrieve values
$arr2 = json_decode($data); //returns ["Hello my, name is Steve", "How are you?"]