Call us Toll-Free:
1-800-218-1525
Live ChatEmail us

 Sponsors

Alphabet Menu for directory listings

Code Wizard, 12-30-2006

A simple array which generates the code for an alphabet menu i.e. A-Z.
The code also creates the URL's automatically in the form of 'A.php3' etc


<?php
// Created by BrettShaw@searchenginetips.co.uk

//create the array
$alpha = array('#', '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');

//format the text output in HTML
echo('<BR><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>');


//Loop through the array
for ($i = 0; $i <= 26; $i++)
{
//if # for misc appears label the link as 123.php3
if ($alpha[$i] == '#')
{

echo('<a href="123.php3">'.$alpha[$i].'</A> ');

}else{

//otherwise call the link the relevant letter
echo('<a href="'.$alpha[$i].'.php3">'.$alpha[$i].'</A> ');

}
}
echo('</B></font><BR><BR>');
?>
Enjoyed this post?

Subscribe Now to receive new posts via Email as soon as they come out.

 Comments
Post your comments












Note: No link spamming! If your message contains link/s, it will NOT be published on the site before manually approved by one of our moderators.



About Us  |  Contact us  |  Privacy Policy  |  Terms & Conditions