/ Published in: PHP
Loops through ASCII characters to display alphabet, useful for alphabetic filtering links.
eg: A | B | C | D ...
eg: A | B | C | D ...
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// Loop through ASCII characters until reaching 90 for ($i=65; $i<=90; $i++) { // store the character // build alphabetical link $alphabet .= '<a title="filter results by letter '.$letter.'" href="/business/'.$letter.'"> '; $alphabet .= $letter; $alphabet .= '</a> | '; } // print links echo $alphabet;
URL: http://www.apashley.co.uk/snippets/38/Loop-Through-The-Alphabet-With-Php.html