If you know the indexes you want to remove, you can simply do:
unset($myarray['first_index_here']);
[... unset more indexes ...]
see also the docs: http://www.php.net/manual/en/language.references.unset.php
If you want to remove the one with smallest value, as per @Leri suggestion, you can try:
unset($myarray[array_search(min($myarray), $myarray)]);
you can also make it into a function and then use it multiple times:
function unset_min(&$array) {
unset($array[array_search(min($array), $array)]);
}
$myarray = array(153=>2 , 154=>0 , 155=>10 , 156=>15 , 157=>8);
// by hand
unset_min($myarray); // removed key 154
unset_min($myarray); // removed key 153
// or with loops
for($i = 0; $i < 2; ++$i) { // replace "2" with the actual number of entries to remove
unset_min($myarray);
}
unset($myarray[array_search(min($myarray), $myarray)]);