讨论一个有趣的有关问题,PHP手册为什么把待搜索的数组叫做$haystack呢?

WBOY
Release: 2016-06-13 13:30:41
Original
980 people have browsed it

讨论一个有趣的问题,PHP手册为什么把待搜索的数组叫做$haystack呢???
mixed array_search ( mixed $needle , array $haystack [, bool $strict ] )

查的字典,haystack中文意思是干草堆,为什么用这个词来命名呢?是因为待选数组就想一堆干草堆一样,是每个元素拼凑到一起的吗?

很有趣,大家一起讨论讨论!

------解决方案--------------------
可以这么理解啊。
------解决方案--------------------
从一堆干草(haystack)里找出一根针(needle),不是很形象吗亲?
------解决方案--------------------
哈哈是啊是啊!
外国人的思维真有意思!

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