Description
Increment a non- numeric string in PHP . Increasing the letter until you reach the next letter . Example : $y = "a" ; $y++; // $y = "b"
Increment a non- numeric string in PHP . Increasing the letter until you reach the next letter . Example : $y = "a" ; $y++; // $y = "b"
<?php
$y = "a" ;
for ($z = 0 ; $z <= 10; $z++)
{
print ($y);
$y++;
}
?>
abcdefghijk
<?php
$y = "A0" ;
for ($z = 0 ; $z <= 10; $z++)
{
print ($y);
$y++;
}
?>
A0A1A2A3A4A5A6A7A8A9B0
<?php
$y = "a01" ;
for ($z = 0 ; $z <= 10; $z++)
{
print ($y);
$y++;
}
?>
a01a02a03a04a05a06a07a08a09a10a11