Home  >  Article  >  Backend Development  >  PHP code to remove duplicate values ​​in array_PHP tutorial

PHP code to remove duplicate values ​​in array_PHP tutorial

WBOY
WBOYOriginal
2016-07-20 11:03:02777browse

 

在$intTotal比较小的情况下,比如说1000以内,$intRand的取值基本不影响结果,两者执行的时间都差不多。

测试$intTotal 大于10000时,$intRand取值100时,使用array_unique的效率要高于foreach循环判断,$intRand=10,两者执行时间一致。

实例

 

Statement:
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