Created
April 14, 2019 14:32
-
-
Save antonioribeiro/f69ea450df65280df3f859dbe0704bf1 to your computer and use it in GitHub Desktop.
Revisions
-
antonioribeiro created this gist
Apr 14, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ function in($needle, ...$haystack): bool { foreach ($haystack as $hay) { if ((is_array($hay) && in($needle, ...$hay)) || $needle == $hay) { return true; } } return false; }