![]() |
sorting help
I have a directory with a bunch of files in it that have filenames that look like 100.html 101.html 102.html 1001.html 1002.html 999.html etc.
I need to sort the filenames numerically. Right now, they are coming up like this: 100.html 1000.html 1001.html 1002.html 1003.html 1004.html 1005.html 1006.html 1007.html 1008.html 1009.html 101.html 1010.html 1011.html 1012.html How can I get these things sorted easily so I can process through the files in the correct order? Amy |
in php?
you should stript the .html then you can do the sorting by integer, and afterwards add the .html again :) |
Quote:
|
isn't that the lazy way? ^^
but looking at php.net brought a very nice function: natsort(array &array) that does what you want regarding the description :) |
All times are GMT. The time now is 08:46 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|