Home  >  Article  >  Backend Development  >  array_search()函数,第3个参数,有什么功用

array_search()函数,第3个参数,有什么功用

WBOY
WBOYOriginal
2016-06-13 12:36:16855browse

array_search()函数,第3个参数,有什么作用?
http://docs.php.net/manual/zh/function.array-search.php

<br />
mixed array_search ( mixed $needle , array $haystack [, bool $strict = false ] )<br />


 strict
    如果可选的第三个参数 strict 为 TRUE,则 array_search() 将在 haystack 中检查完全相同的元素。 这意味着同样检查 haystack 里 needle 的 类型,并且对象需是同一个实例。


问题:
这个函数,第3个参数:$strict = false,有什么作用?
给个实例。

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