$sh_array = array()
;
foreach (
$data[
0]
as $ite){
reset(
$ite)
;
$first=current(
$ite)
;
array_push(
$sh_array, $first)
;
}
$ch_array = array()
;
foreach (
$data[
0]
as $item){
reset(
$item)
; //指针的使用
current(
$item)
;
$first=next(
$item)
;
array_push(
$ch_array,$first)
;
}
//判断导入的数据是非有重复值
if (
count(
$ch_array)
!= count(
array_unique(
$ch_array))) {
return response()
->json([
'status'=>0,'msg'=>'该导入数组有重复值'])
;
}
转载请注明原文地址: https://www.6miu.com/read-31233.html