/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function str_inc($str, $pos = 0) { $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_'; if($len == 0) { return $chars[0]; } $strindex = $len - $pos - 1; if($strindex < 0) { return $chars[0] . $str; } $char = $str[$strindex]; if($charsindex == $charsmax) { $str[$strindex] = $chars[0]; return str_inc($str, $pos + 1); }else{ $str[$strindex] = $chars[$charsindex + 1]; return $str; } }