Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function nextID($id) {
- $avail_chars = $this->config->item('link_id_chars'); //a string, no dupe chars plz.
- if($id === '') {
- return $avail_chars[0];
- } else if($id[strlen($id)-1] === $avail_chars[strlen($avail_chars)-1]) {
- return $this->nextID(substr($id, 0, -1)).$avail_chars[0];
- } else {
- return substr($id, 0, -1).$avail_chars[strrpos($avail_chars,$id[strlen($id)-1])+1];
- }
- }
Add Comment
Please, Sign In to add comment