批改状态:合格
老师批语:
<?php
//删
$stu =array('id'=>6,'name'=>'xiaoli','age'=>29,'city'=>'厦门');
//返回删除的后面两元素
(array_splice($stu,2));
//保留的二个元素
print_r($stu);
echo'<hr color="#FF0000">';
//改
$stu =array('id'=>6,'name'=>'xiaoli','age'=>29,'city'=>'厦门','学号'=>'2326');
(array_splice($stu,4,1,['李老师']));
print_r($stu);
echo'<hr color="#FF0000">';
//增
$stu =array('id'=>6,'name'=>'xiaoli','age'=>29,'city'=>'厦门','学号'=>'2326');
array_splice($stu,4,0,['password']);
print_r($stu);
echo'<hr color="#FF0000">';
//查
$stu =array('id'=>6,'name'=>'xiaoli','age'=>29,'city'=>'厦门','学号'=>'2326');
print_r(array_splice($stu,2,1));
?>点击 "运行实例" 按钮查看在线实例
手抄:
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号