![]() |
Re: PHP Help Needed
Can there somwhow be a character zero involved in the sorting, as I guess the string of the filename starts with character one.
So if it tried to sort with a non existant character it would get a random one?? What if you try to define that it should sort by characters 1-3 in the filenmane? Very Wild guess!! |
Re: PHP Help Needed
How about case?
Transform all to lowercase first before sorting? Edit: array_multisort(StrToLower($fileArray)); Or rather make it to lowercase when reading in the files, as the above propably won't work. [ December 06, 2003, 01:41: Message edited by: Ruatha ] |
Re: PHP Help Needed
They are all lowercase to begin with.
|
Re: PHP Help Needed
Here is the result from running the original file you posted on my server:
http://pbw.ath.cx/sort2.php As you can see, it sorts them right but it doesn't display the Last file. (Ignore all the errors and skip to the bottom) (I've downloaded all the zip files.) So it seems to perhaps be something with linux filesystem?? [ December 06, 2003, 02:20: Message edited by: Ruatha ] |
Re: PHP Help Needed
Could be. I think all of those errors are due to misconfigurations in your PHP files... I only used standard PHP functions and such, and did not define anything with any names given by the errors.
|
Re: PHP Help Needed
Quote:
I have standrad settings for most PHP settings except file sizes and magic quotes. [ December 06, 2003, 07:55: Message edited by: Ruatha ] |
Re: PHP Help Needed
Quote:
array_multisort($fileArray[0], SORT_ASC, SORT_STRING);//sorts by names. Have you noticed when you use $file = readdir($dir_handle) you get first "." and then ".." and but then real filenames. |
Re: PHP Help Needed
Quote:
array_multisort($fileArray[0], SORT_ASC, SORT_STRING);//sorts by names. Have you noticed when you use $file = readdir($dir_handle) you get first "." and then ".." and but then real filenames. </font><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">Yep, it's the current directory "." and the directory above ".." as in ms dos; CD.. |
Re: PHP Help Needed
Fyron, did you get the sorting working or did you lost interest to the whole thing?
|
All times are GMT -4. The time now is 02:50 AM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.