php unset和array_splice区别

平时在设计程序时,常常要应用PHP删除数组元素的函数有unset和array_splice,这两个函数的运行有何差别呢? 用unset,有个缺陷.如$a是一个数组:php < ?php $a=array("red", "green", "blue", "yellow"); count($a); //获得4   unset($a[1]); //删除第二个元素 count($a); //获得3    
相关文章
相关标签/搜索