24
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

a needle in a haystack(引数どっちだっけ?)

Posted at

PHPのstrpos関数などで、

strpos($haystack, $needle)

あれ、この引数どっちがどっちだっけ…?と時々なるので、単語の意味をググりました。

needle = 針
haystack = 干し草

ふむ。
これは元々イディオムから来ているようで、

a needle in a haystack
=「干し草の中の一本の針
⇒ "look for ~"で「望みのない捜し物をする、むだ骨を折る」というニュアンスになるようです。

なるほど~。
語彙力が問われる命名ですねぇ。
でもこれで覚えた!

(参考)
A NEEDLE IN A HAYSTACKは何て意味?【イディオムを覚えよう】
strstr 関数の haystack と needle

24
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
24
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?