| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Senior Member Join Date: Jul 2004 Location: Florida
Posts: 1,492
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Alphabetizing a textbox I tried searching google, but didn't find anything. I want to post data into a textbox and click a button to alphabetize the data either A to Z or Z to A Does anyone know of a code to do such a thing? |
| |
| | #2 (permalink) |
| NamePros Regular Join Date: Mar 2006 Location: United Kingdom
Posts: 413
![]() ![]() ![]() | If you can get all the pieces of data into an array, then you can do it using PHP's sort() function, example: PHP Code:
__________________ Linux Screenshots |
| |
| | #3 (permalink) |
| NamePros Regular Join Date: May 2004 Location: NYC
Posts: 236
![]() ![]() ![]() | PHP Code: |
| |
| | #5 (permalink) |
| NamePros Regular Join Date: May 2004 Location: NYC
Posts: 236
![]() ![]() ![]() | Oops, forgot about the reverse. That only requires one extra optional call, and another button on the form. I'll update shortly. With reverse sorting added: PHP Code: |
| |