Example 1 — Step Forward One Letter
Each call moves the string one step ahead.
<?php
echo str_increment("a"), PHP_EOL;
echo str_increment("Az"), PHP_EOL; How It Works
- Pass a letter.
abecomesb. - Carry when needed.
zwraps toaand the letter before it grows. - Case is kept.
AzbecomesBa. - Always returns a string. Even for digits.

