I have an array which is expressed in this way:
$id = $values['ids'];
Result:
array(6) { [0]=> string(1) "4" [1]=> string(1) "6" [2]=> string(1) "7" [3]=> string(1) "8" [4]=> string(1) "9" [5]=> string(2) "10" }
Originally, I was imploding this array so that I could pass it off as a value to use in $_POST:
$id = implode(",", $values['ids']);
Result:
string(12) "4,6,7,8,9,10"
In my $_POST page, I need to revert back to the original array, but when I use explode, I now get this result:
$id2 = explode(" ", $id);
//array(1) { [0]=> string(12) "4,6,7,8,9,10" }
I think the issue is how I am imploding this in the first place - it's making the individual values as one string, but not sure what to do in order to get the result I need. I need to pass the array on as a value, and then put it back into the original format that it was in as the array. Does anyone know what I should do?
explode()?