$cart = $_SESSION['cart'];
if ($cart) {
$items = explode(',',$cart);
//what should i do next?? the value of $items is 4,4,2,2,2,4
$cart = $_SESSION[‘cart’]; if ($cart) { $items = explode(‘,’,$cart); //what should i do next??
Share
To get array without duplicate use array_unique()
Hope this is what required.