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
https://forums.phpfreaks.com/topic/46122-auto-increment-non-numeric-values/
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

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.