How to increment a letter by N in PHP

1 Answer

0 votes
function increaseby($ch, $n) {
	$i = 0;
	while ($i < $n) {
		$ch++;
		$i++;
	}
	return $ch;
}

$ch = 'a';

$ch = increaseby($ch, 5);

echo $ch;



/*
run:
 
f
 
*/

 



answered Aug 22, 2020 by avibootz

Related questions

...