Created
April 4, 2019 22:14
-
-
Save donjajo/85d4887c408389402df511e4081282ba 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 | |
$numbers = [ 3,3,2,2,56,4,4 ]; | |
$checked = []; | |
foreach( $numbers as $number ) { | |
$checked[ $number ] = !empty( $checked[ $number ] ) ? $checked[ $number ] + 1 : 1; | |
} | |
asort( $checked ); | |
echo current( array_keys( $checked ) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment