$colors = array("blue","green","red");
//delete element in array by value "green"
if (($key = array_search("green", $colors)) !== false) {
unset($colors[$key]);
}
array_diff( [312, 401, 15, 401, 3], [401] ) // removing 401 returns [312, 15, 3]