$array = array( "one" => 1, "two" => 2, "three" => 3, "four" => 4 ); $new_array = array_diff_key($array, array("two" => "")); print_r($new_array);
Array ( [one] => 1 [three] => 3 [four] => 4 )
$array = array( "one" => 1, "two" => 2, "three" => 3, "four" => 4 ); $new_array = array_diff_key($array, array("two" => "", "four" => "")); print_r($new_array);
Array ( [one] => 1 [three] => 3 )
$array = array(1, 2, 3, 4, 5); $new_array = array_diff($array, array(2, 3, 4)); print_r($new_array);
Array ( [0] => 1 [4] => 5 )