Forget Haystack vs Needle order, the object IS the Haystack. Haystack is a library that allows for pipelining, immutable structures, and UTF-8 strings.
Haystack is installable as a Composer package:
$ composer require ericpoe/haystack
$ git clone ... $ composer install $ vendor/bin/phpunit
Trying to remember commonly-used PHP functions for strings and arrays in PHP is hard. Are array functions
haystack-needle and string functions needle-haystack, or vice versa? Quick, without looking at documentation or using
a decent IDE, which is correct:
in_array($needle, $haystack) or
Also, even though many of the same kinds of functions are run against arrays and strings, the function names are
in_array do similar things, yet have different names and are called in
This project will attempt to match as many string and array verbs as possible. For example,
should determine if the string "elvis" is contained in the $foo object, it shouldn't matter if
$foo is a string or
an array. Ditto
How do I?
Check out the manual for all the things you can do with the Haystack library.