2021年3月

in_array 是通过遍历数组来进行判断的 时间复杂度是O(n),当数组很庞大时非常耗时
优化:
1.将数组key,val转换 array_flip,使用 isset来判断 时间复杂度是O(1)
2.将数组转换为字符串用 strpos来判断