$colors = array("blue","green","red");
//delete element in array by value "green"
if (($key = array_search("green", $colors)) !== false) {
unset($colors[$key]);
}
$colors = array("blue","green","red");
//delete element in array by value "green"
if (($key = array_search("green", $colors)) !== false) {
unset($colors[$key]);
}
unset($dataArray['key']);
<?php
$array = array("size" => "XL", "color" => "gold");
print_r(array_values($array));
?>
Array
(
[0] => XL
[1] => gold
)
unset($dataArray['key']);
<?php
$array = array("size" => "XL", "color" => "gold");
print_r(array_values($array));
?>
Array
(
[0] => XL
[1] => gold
)
array_diff( [312, 401, 15, 401, 3], [401] ) // removing 401 returns [312, 15, 3]
array_diff( [312, 401, 15, 401, 3], [401] ) // removing 401 returns [312, 15, 3]