Home > Backend Development > PHP Tutorial > 求解,怎样比较2个数组的大小解决方法

求解,怎样比较2个数组的大小解决方法

WBOY
Release: 2016-06-13 10:09:57
Original
1313 people have browsed it

求解,怎样比较2个数组的大小
一个数组是数据库读出来的,一个数组是用循环写的
  for ($ii='A'; $ii for ($i=1; $i
if($q!=$rack_id . $ii . $i)
{
echo " ";
}
}
}

数据读出来的如
A02B2
A02B3
A02B4
A02B5
A02B6

循环生成的如:
A02B2
A02B3
A02B4
A02B5
A02B6
B02B2
B02B3
B02B4
B02B5
B02B6
怎样去掉重复的?

------解决方案--------------------
比较数组哪方面的大小?
------解决方案--------------------
array_diff
------解决方案--------------------
array_diff 就是了,取交集。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template