i want to unset value as 12 in this array "" [0] = 15 , [1] => 12 , [2] => 20 "". i can remove [1] but value as 12 require for remove [1]. i want to remove value as 12 but How?
This should do: $sampleArray = array(0 => 15, 1 => 12, 2 => 20); $key = array_search(12, $sampleArray); unset($sampleArray[$key]); PHP: