Home > php教程 > php手册 > 删除数组中重复值的php代码

删除数组中重复值的php代码

WBOY
Release: 2016-06-13 11:19:09
Original
742 people have browsed it

 

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

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

实例

 

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template