1
$x = 'a'
$x ++;

Outputs b

$x = 'z'
$x ++;

Outputs aa

I'm trying to get this same result but using a charset array, so I could use numbers, and capital letters as well for a more possible combinations, does anyone know how to do this?

1 Answer 1

3
<?php
   $str = 'a';
   echo ++$str; // b

   $str = 'z';
   echo ++$str; // aa

   $str = 'aA';
   echo ++$str; // aB
?>
Sign up to request clarification or add additional context in comments.

1 Comment

that doesn't work. it may look like it works but it just capitalizes the last character of every output. puu.sh/4G6Pw.png

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.