Jump to content

Auto-increment non-numeric values


Millar

Recommended Posts

I have a string with a line of alpha-numeric values. I want a function to take the previous value u and then increment it by one, in order of the string.

 

So, if the string was "1234567890abcdefghijklmnopqrstuvwxyz", 1 goes to 2, 0 goes to a, and z would go to 11.

But endlessly so something like dw34fz would go to dw34g1.

 

If anybody has anything that can do this or can write it I would be very thankful.

Link to comment
Share on other sites

um, not sure is this helps, or if php has this sort if thing, but look for string indexing ( i know slicing exists )  you may have to write a function manually, but it should be possible.

 

id go something like incrimenting a number, then corisponding that to the string indexing

 

 

if you ned more help, ill try to come up with something, but i cant garentee itll wrk, i dont do much string slicing at all ( in fact, i only know the theaory behind i)

 

 

good luck

 

pm me if you need more help

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.