$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
]
*/
$arr1=array('geeks',// [0]'for',// [1]'geeks'// [2]);// remove item at index 1 which is 'for'unset($arr1[1]);// Re-index the array elements$arr2=array_values($arr1);// Print re-indexed arrayvar_dump($arr1);
$array=[0=>"a",1=>"b",2=>"c",3=>"d"];//Params are: array,index to delete,number of elements to removearray_splice($array,2,1);//print_r($array); //Array//(// [0] => a// [1] => b// [2] => d//)