//$non_alpha = array('1','2','3','4');
$alphabetical_array = range('a','z');
//$final_array = array_merge($non_alpha, $alphabetical_array);
function AddLinks($letter)
{
$title = strtoupper($letter);
$a = "
".$title."";
return($a);
}
// Use array_map to modify the array by adding the links
$format_array = array_map("AddLinks", $alphabetical_array);
?>
print "
Browse by subject
";
echo "
";
echo implode(" | ", $format_array);
echo "
";
?>
//echo implode(" | ", $alphabetical_array);
//$tags = array('african americans', 'miami', 'mcguffey', 'women', 'history', 'portraits', 'images', 'education');
$tags = array_keys($tags);
//print_r($tags);
function alpha_search($array, $letter = 'a') // 'a' is the default value
{
return array_filter($array, create_function('$var', 'return (strtolower(trim($var{0})) == strtolower("'.$letter.'"));'));
}
//begin display by groups
foreach ($alphabetical_array as $key => $value) {
echo "
[ " . strtoupper($value) . " ]
";
$nuevo = alpha_search($tags, $value);
foreach ($nuevo as $value) {
$search_tag = str_replace(" ", "%20", $value);
?>
•
echo $value ?>
}
?>
}
//end display by groups
?>