<?php
function item_set_attr(&$basketarray,$item,$typ,$quant){
  $counter=0;
  foreach($basketarray as $position){
    if($position['item']==$item){
      $basketarray[$counter]['typ']=$typ;
      $basketarray[$counter]['quant']=$quant;
    }
    $counter++;
  }
}

function item_remove(&$basketarray,$itemid){
  unset($basketarray[$itemid]);
  $temparray=array();
  foreach($basketarray as $position){
    $temparray[]=$position;
  }
  $basketarray=$temparray;
}

function item_position($basketarray,$searchitem){
  $counter=0;
  foreach($basketarray as $position){
    if($position['item']==$searchitem) return $counter;
    $counter++;
  }
  return FALSE;
}

?>