remove any element from array php code example
Example: Deleting an element from an array in PHP
$array = [0 => "a", 1 => "b", 2 => "c"];
unset($array[1]); //Key which you want to delete
/*
$array:
[
[0] => a
[2] => c
]
*/
//OR
$array = [0 => "a", 1 => "b", 2 => "c"];
array_splice($array, 1, 1);//Offset which you want to delet
/*
$array:
[
[0] => a
[1] => c
]
*/