I have tried most of the solutions I found, but cannot get it to work.
I have a form parameter that post list of ids separated with commas in a string as per
$list_of_ids = "261,420,788";
Now I need to convert the list of ids into object or arrays so that I can loop through it and insert into database.
My problem is how I can make it look like this:
["261","420","788"]
Here is how I will like to loop it and update database
foreach($list as $id){
echo $id;
// loop and update database
}