in reply to Sort an array which contains date formatted elements
The reason that "it is taking the elements as strings even though i gave it to sort in numerical way" is because the filenames start with text, not numbers. If they were formatted as 7_jul_2007_webadmin.log, then your sort idea would have worked (until 1_aug_webadmin.log, at least - any change of month would break it) but, with the current filename formatting, all of the filenames have a numerical value of 0, so sorting them numerically doesn't do much.
|
|---|