Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

删除数组元素 【php】

View gist:1787992
1 2 3 4 5 6 7 8 9 10
<?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
Something went wrong with that request. Please try again.