|
Sorting people by name in PHP
Our petition for a reasonable train service is going great guns - over 1000 signed up in just over a week, amongst them significant players such as MPs, MEPs .... but, my goodness, the list as presented by the web site is hard to look through. So I've grabbed a copy of the list and sorted it - see here.
Sorting by name is not straightforward!
If you just do an alphabetic sort, you get everyone with the same forename first - I've got a customer who does that with their internal phone directory and, goodness, it's awkward to us. So you need a sort routine thats sorts based on the LAST space separated word.
Except that there's a group of people who add things like "MP", "MEP" and "MBE" after their names and that becomes the final field. Actually, I want to highlight those people into a separate list.
and then some MPs and MEP sign up and DON'T add in their 'letters' ....
If you want to have a look at my solution to the awkward sort, I've added in the source code to my training examples and it's here. It works well, but in some cases there's no east way that adding in specific tables of exceptions .... (written 2007-01-26 07:25:14)
Associated topics are indexed under H110 - PHP - HTML Web Page Data HandlingH999 - Additional PHP Material
Some other Articles
Selling by phone and Skype - our policyAnother frantic posting!Above the foldUK legal requirements for your commercial web siteSorting people by name in PHPLearning to write secure, maintainable PHPToo busy to blog it - but it's great (mostly)The HTML++ MetalanguageJava 6, Apache Tomcat 6.Getting rid of people - hotel techniques
|
2259 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46 at 50 posts per page
This is a page archived from The Horse's Mouth at
http://www.wellho.net/horse/ -
the diary and writings of Graham Ellis.
Every attempt was made to provide current information at the time the
page was written, but things do move forward in our business - new software
releases, price changes, new techniques. Please check back via
our main site for current courses,
prices, versions, etc - any mention of a price in "The Horse's Mouth"
cannot be taken as an offer to supply at that price.
Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).
|
|