Last active
June 30, 2017 00:41
-
-
Save neatstudio/6601f22a214592579aa3 to your computer and use it in GitHub Desktop.
php : in array
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( | |
1 => array('n' => 'a1', 'p' => 1, 't' => 'a', 'bk' => array('2'), 'cd' => 2), | |
2 => array('n' => 'a2', 'p' => 2, 't' => 'a', 'ak' => array('3', '4'), 'cd' => 1), | |
3 => array('n' => 'a3', 'p' => 3, 't' => 'a', 'cd' => 1), | |
); | |
$ret = in_array(false, array_map(function ($item) { | |
return $item['cd'] ? true :false; | |
}, $array)); | |
var_dump($ret); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment