Created
April 20, 2016 22:40
-
-
Save kkopachev/fd8613d052cccf80ba921e0932230521 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 = range(1,100); | |
while(count($a) > 1) { | |
$key = key($a); | |
unset($a[$key]); | |
if ( false === current($a) ) { | |
reset($a); | |
} | |
if ( false === next($a) ) { | |
reset($a); | |
} | |
} | |
echo reset($a), PHP_EOL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment