Last active
March 22, 2024 16:02
-
-
Save ziadoz/9c15e77c5bbab95d31dd1d44ea842351 to your computer and use it in GitHub Desktop.
PHP - Find Min/Max Count in Multi-Dimensional 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 | |
// @see: https://stackoverflow.com/questions/21861825/quick-way-to-find-the-largest-array-in-a-multidimensional-array | |
$array = [ | |
['foo', 'bar'], | |
['foo'], | |
['foo', 'bar', 'baz'], | |
]; | |
echo count(max($array)) . PHP_EOL; | |
echo count(min($array)) . PHP_EOL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment