Last active
November 20, 2017 11:02
-
-
Save anthonybudd/9c32cc1698cb8b1d6144944a402e3c1c to your computer and use it in GitHub Desktop.
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 characters
| <?php | |
| $array = ['quick', 'fox']; | |
| $string = 'the quick brown fox jumps over the lazy dog'; | |
| if(in_array(1,array_map(function($e)use($string){return(strpos($string, $e)!== FALSE)?1:0;},$array))){ | |
| echo "The string contains an element in the array."; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since when did PHP have arrow functions lmao