dtyson2000 Posted June 21, 2012 Share Posted June 21, 2012 Afternoon! This is probably something very straightforward but I haven't been able to locate a resource. I have a list of names and would like to provide a set of links (alphabet at the top of the list) to the first instance of a last name starting with that letter. The (a href='#s') jumping to (a name='s') isn't the issue. Grabbing the names from the database and dynamically grabbing the first instance of a last name that starts with the next letter and inserting the 'a name=' tag is. Is there a resource for this anywhere that you can point me to? Thanks, ahead of time! Link to comment https://forums.phpfreaks.com/topic/264573-alphabetical-anchor-tags/ Share on other sites More sharing options...
Jessica Posted June 21, 2012 Share Posted June 21, 2012 Have you written any code? Link to comment https://forums.phpfreaks.com/topic/264573-alphabetical-anchor-tags/#findComment-1355874 Share on other sites More sharing options...
dtyson2000 Posted June 21, 2012 Author Share Posted June 21, 2012 Aside from the basic query and output, no I haven't started because I'm not sure how to go about analyzing each result (well I guess I can figure that part out) and then limit the action needed (the insertion of a string of html) to just the first instance of the letter A, then B, etc. Sorry this may sound vague. Link to comment https://forums.phpfreaks.com/topic/264573-alphabetical-anchor-tags/#findComment-1355879 Share on other sites More sharing options...
dtyson2000 Posted June 21, 2012 Author Share Posted June 21, 2012 Wow that wasn't bad. I actually just used the $string[0] to get the first letter of the last name and wrapped it in (a name='$string[0]') then stuck the links at the top of the list as hrefs. All fixed. Much Ado about Nothing! ;-) Link to comment https://forums.phpfreaks.com/topic/264573-alphabetical-anchor-tags/#findComment-1355887 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.