Answers for "remove array element with out keys"

PHP
5

php unset array key

unset($dataArray['key']);
Posted by: Guest on June-01-2020
14

php delete element from array

//Delete array items with unset(no re-index) or array_splice(re-index)
$colors = array("red","blue","green");                             
unset($colors[1]);//remove second element, do not re-index array

$colors = array("red","blue","green");
array_splice($colors, 1, 1); //remove second element, re-index array
Posted by: Guest on August-06-2019

Code answers related to "remove array element with out keys"

Browse Popular Code Answers by Language