Array
(
[0] => Array
(
[year] => 2013-2014
[term] => 1
[course_code] => 00008069
[course_name] => 咖啡世界
[course_nature] => 任意选修
[course_attribution] => 人文素养类
[credit] => 2.0
[point] => 4.1
[grade] => 91
[minor_tag] => 0
[makeup_grade] =>
[rebuild_grade] =>
[begin_college] => 旅游文化产业学院
[remark] =>
[rebuild_tag] => 0
[0] => 77
[1] => 2
)
[1] => Array
(
[year] => 2013-2014
[term] => 1
[course_code] => 00008069
[course_name] => 咖啡世界
[course_nature] => 任意选修
[course_attribution] => 人文素养类
[credit] => 2.0
[point] => 4.1
[grade] => 91
[minor_tag] => 0
[makeup_grade] =>
[rebuild_grade] =>
[begin_college] => 旅游文化产业学院
[remark] =>
[rebuild_tag] => 0
[0] => 77
[1] => 2
)
[2] => Array
(
[year] => 2013-2014
[term] => 1
[course_code] => 00008069
[course_name] => 咖啡世界
[course_nature] => 任意选修
[course_attribution] => 人文素养类
[credit] => 2.0
[point] => 4.1
[grade] => 91
[minor_tag] => 0
[makeup_grade] =>
[rebuild_grade] =>
[begin_college] => 旅游文化产业学院
[remark] =>
[rebuild_tag] => 0
[0] => 77
[1] => 2
)
)
如上面 怎样让它变成
Array
(
[0] => Array
(
[year] => 2013-2014
[term] => 1
[course_code] => 00008069
[course_name] => 咖啡世界
[course_nature] => 任意选修
[course_attribution] => 人文素养类
[credit] => 2.0
[point] => 4.1
[grade] => 91
[minor_tag] => 0
[makeup_grade] =>
[rebuild_grade] =>
[begin_college] => 旅游文化产业学院
[remark] =>
[rebuild_tag] => 0
[0] => 77
[1] => 2
)
}
大神给支个招,拜谢
希望对你有帮助,望采纳
$arr=array(
0=>array(
'name'=>"xxx",
'age'=>23,
'school'=>"yyyy大学"
),
1=>array(
'name'=>"xxx",
'age'=>23,
'school'=>"yyyy大学"
),
2=>array(
'name'=>"xxx",
'age'=>23,
'school'=>"yyyy大学"
)
);
$delete_key=0;//需要找的重复的数组的下标值
$value=$arr[$delete_key];//获取其值
$key=array_keys($arr,$value);//需要同样的值的下标
foreach ($key as $k=>$v)
{
if($v!=$delete_key)//第一个值不删,其它的删除
unset($arr[$v]);
}
echo"<pre>";
var_dump($arr);
echo"</pre>";
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。