chr():-

The chr() function returns a character from the specified ASCII value.

The ASCII value can be specified in decimal, octal, or hex values. Octal values are defined by a leading 0, while hex values are defined by a leading 0x.

ord():-

The ord() function returns the ASCII value of the first character of a string.


code:-
 
<?php
for ($x = ord('a'); $x <= ord('z'); $x++)
 echo chr($x);
?>

output:-

abcdefghijklmnopqrstuvwxyz

Post a Comment

If you have any doubts, Please let me know
Thanks!

Previous Post Next Post