Hi,
I am creating a SESSION based array that will contain the items / quantities that a person can purchase on a given day. If the person has a userid of say 171, and purchases items through a form, then the SESSION array will be populated as:
$_SESSION[171][0]= array(‘dateval’=>’2012-07-29’,’item1#’=>12,’quantity1’=>2,’item2#’=>16,’quantity2’=>1,’item3#’=>16,’quantity3’=>1))
$
Now through the same form the person may go and modify one of the quantities, say they change the quantity (represented by quantity2), for item2# on 2012-07-30. The change is that instead of 2 units of item2# they choose to buy 1.
So the new values for that day will be:
‘dateval’=>’2012-07-30’,’item1#’=>4,’quantity1’=>1,’item2#’=>20,’quantity2’=>1,’item3#’=>16,’quantity3’=>2
I want to know what I can use to search if an entry for 2012-07-30 already exists in the $_SESSION array and if it exists delete the entire entry corresponding to 2012-07-30 from the $
There are so many array functions but I am not sure which one will fit my need.
Will it be easier to do a replacement of values for that day’s entries instead. If so how?