unset删除以后数组的索引值不会发生变化,array_splice会发生变化
比如:
$arry = array([0]=>'a', [1]=>'b', [2]=>'c', [3]=>'d');
$result1 = unset($arry[2]);
$result2 = array_splice($arry[2]);
//这时$result1为array([0]=>'a', [1]=>'b', [3]=>'d');
//这时$result2为array([0]=>'a', [1]=>'b', [2]=>'d');