Forum Moderators: coopster
Here is what I want to do.
At the top of the page I want to list each letter of the alphabet and have it as a link. From that link (lets say "G") when I click on G it jumps to the first employee that has a last name that starts with G (staying on the same page)
Is there some way to create a dynamic anchor that would jump to a specific areas based on how the alphabet link was coded?
this could help you. i just wrote it in 2 min. but i tested it and it works.
foreach ( $aEmployees as $aEmployee ) {
$sLetter = substr($aEmployee['last_name'], 0, 1);
if ($sLetter!= $sLetterOld) {
echo '<a name="' . $sLetter . '"></a>' . "\n";
}
echo $aEmployee['first_name'] . ' ' . $aEmployee['last_name'] . '<br>' . "\n";
$sLetterOld = $sLetter;
}
hope this helps
barn