In my script the user builds up an array of options. One value stores the name of the item whilst the other stores the amount of that item they will have selected.
So when printed out it will look like this.
Array ( [0] => Array ( [name] => wheel [quantity] => 1 )
[1] => Array ( [name] => bumper [panvalue] => 1 )
[2] => Array ( [name] => mirror [panvalue] => 1 ) )
I have two question.
Firstly how would I check if a [name] already contains a value of say wheel?
Secondly when this is found how would I then increase the [quantity]?
I assume that with the first quetion it will be using if(isset ) but I'm unsure on the rest of the syntax.
And for the second when I have retrieved the value form the array simply using ++ to increment.
The above array is stored in the session variable $_SESSION['list']
Thanks for any help.