i am adding stuff to a 2d array like this:
$_SESSION['vehicles'][] = array ('model' => $_REQUEST['blah1'], 'price' => $_REQUEST['blah2'], 'year' => $_REQUEST['blah3']);
how would i remove all arrays from the session that have a 'model' = to a variable of my choice? (note: there will always be many arrays in the session with the same model.)
i have tried the below but it doesn't seem to remove anything from my session array:
$model = "toyota";
foreach ($_SESSION['vehicles'] as $vehicle)
{
unset($vehicle[$model]);
}
Thanks!