<< Back to Code Zen

Dynamic Display of Alphabet

<?php
for ($i=65; $i<=90; $i++) {
	echo chr($i);
}
?>
ABCDEFGHIJKLMNOPQRSTUVWXYZ

---------------------------------------------------------------

<?php
for ($i=97; $i<=122; $i++) {
	$x = chr($i);
	echo '<a href="alphabet.php?letter=' . $x . '>' . strtoupper($x) . '</a> ';
}
?>
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

---------------------------------------------------------------