Well, the ++
is pretty strictly defined in what it does - increments characters by ASCII values, for a very limited range of characters, so your problem will most likely need a custom solution.
I tried:
$start = 'a';
$end = '999';
$seq = 'abcdefghijklmnopqrstuvwxyz0123456789';
while($start != $end)
{
echo $start . "\n";
$pass = 1;
for ($i = strlen($start) - 1; $i >= 0; $i--) {
if (!$pass) break;
else $pass--;
$last = substr($start, $i, 1);
$pos = strpos($seq, $last);
if ($pos == strlen($seq) - 1) {
$pos = 0;
$pass++;
} else $pos++;
$start[$i] = $seq[$pos];
}
if ($pass) $start .= substr($seq, 0, 1);
}
which, if you accept my comment, gets you the sequence you seem to want. All the code does is manually go through $start
backwards, incrementing the character to the next one in $seq
and, if it's the last one, set it to the first one and "carry the one". Really, it's just a character sum.