Create a gist now

Instantly share code, notes, and snippets.

删除数组元素 【php】
<?php
$t = array(1, 3, 4, 5);
var_dump($t);
foreach($t as $k => &$v){
if(1 === $k){
unset($t[$k]);
//unset($v); //这种方法不起作用
}
}
var_dump($t);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment