Phil, let's go back to basics: an array is a compound variable type that consists of indexes. each individual index is made up of two things: a key and a value. in PHP (unlike some other languages, like PERL) all arrays are associative arrays, meaning there is always a key for each value and that key can be any scalar type (integer, string). if you don't specify the array keys then PHP will do it for you using integers starting at 0.
let's go back to our simple array:
$array = array(
1 => 'one',
2 => 'two',
3 => 'three',
4 => 'four',
5 => 'five'
);
let's say we want to get rid of the index containing the key that equals "3". let's say we want to do that and we don't know about nor care about what the corresponding value is. then we can simply do:
unset($array[3]);
now let's then say we want to get rid of the index containing the value that equals "four". let's again say we don't know about nor care about what the corresponding key is. this a bit trickier because cannot simply do:
unset($array['four']);
we must iterate thru the array and test the values to find which is the corresponding key.
foreach ($array as $key => $value)
{
if ($value == 'four')
{
unset($array[$key]);
break;
}
}
this can be done even simplier by using the [man]array_search[/man] fucntion which does the leg work for us:
unset($array[array_search('four', $array)]);
to be clear: by using [man]unset[/man] we are not just removing the key or just removing the value, we are rmoving the entire index (both).
again, it all boils down to whether you know the key in question or not. if you don't then you must use the second method above.
sorry if this all obvious stuff, i'm just trying help.