Created
February 24, 2018 10:03
-
-
Save telless/5a314f589a86c7e7795e43c60a5d84fd to your computer and use it in GitHub Desktop.
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 | |
$a = [1, 1, 1, 2, 3, 3, 4, 5, 5, 5, 5, 6, 6, 6, 6]; | |
$count = []; | |
foreach ($a as $v) { | |
if (isset($count[$v])) { | |
unset($count[$v]); | |
} else { | |
$count[$v] = true; | |
} | |
} | |
echo join(' ', array_keys($count)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment