Last active
September 20, 2015 18:57
-
-
Save shatko/fd6634343e97ed9499a7 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
function getNextFactId($currentId, $EveryCroid) { | |
reset($EveryCroid); | |
while (!in_array(current($EveryCroid), [$currentId, null])) { | |
next($EveryCroid); | |
} | |
$nextFactId = next($EveryCroid); | |
if ($nextFactId > end($EveryCroid)) { | |
$$nextFactId = reset($EveryCroid); | |
} | |
return $nextFactId; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment