Created
July 17, 2012 13:59
-
-
Save ondrejmirtes/3129530 to your computer and use it in GitHub Desktop.
Array contains item starting with X
This file contains 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 = array_filter(array('yx', 'y', 'z')); | |
$exists = count(array_filter($array, function($item) { | |
return substr($item, 0, 1) === 'x'; | |
})) > 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment