呓语Beta 2.0 首页 镜头后 灶台前 捐赠者名单 有趣的小站

PHP unset数组对象测试

文档信息

PHP unset数组对象测试

测试代码

$a = array(
    'first', 'second', 'third'
);

//var_dump($a);
foreach($a as $k => $v) {
    echo "{$k}:{$v}\n";
}
echo "\n";

$b = $a;
unset($b[0]);
//var_dump($b);
foreach($b as $k => $v) {
    echo "{$k}:{$v}\n";
}
echo "\n";

$b = $a;
unset($b[1]);
//var_dump($b);
foreach($b as $k => $v) {
    echo "{$k}:{$v}\n";
}
echo "\n";

$b = $a;
unset($b[2]);
//var_dump($b);
foreach($b as $k => $v) {
    echo "{$k}:{$v}\n";
}
echo "\n";

捐赠支持

可以使用支付宝转帐给richard.ma.19850509#gmail.com(请将#替换为@),谢谢!

Fork me on GitHub