Guest User

Untitled

a guest
Mar 17th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. function nextID($id) {
  2. $avail_chars = $this->config->item('link_id_chars'); //a string, no dupe chars plz.
  3. if($id === '') {
  4. return $avail_chars[0];
  5. } else if($id[strlen($id)-1] === $avail_chars[strlen($avail_chars)-1]) {
  6. return $this->nextID(substr($id, 0, -1)).$avail_chars[0];
  7. } else {
  8. return substr($id, 0, -1).$avail_chars[strrpos($avail_chars,$id[strlen($id)-1])+1];
  9. }
  10. }
Add Comment
Please, Sign In to add comment