How to increment letters like numbers in PHP?

后端 未结 8 1378
孤城傲影
孤城傲影 2020-11-27 16:41

I would like to write a function that takes in 3 characters and increments it and returns the newly incremented characters as a string.

I know how to increase a sing

8条回答
  •  醉酒成梦
    2020-11-27 16:58

    You could use the ASCII codes for alpha numerics. From there you increment and decrement to get the previous/next character.

    You could split your string in single characters and then apply the transformations on these characters.

    Just some thoughts to get you started.

提交回复
热议问题