|
|
|
 |

December 6th, 2003, 03:25 AM
|
 |
Shrapnel Fanatic
|
|
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
|
|
Re: PHP Help Needed
Now look at it when it is using multisort... almost in order, but not quite. 
|

December 6th, 2003, 03:27 AM
|
 |
Major General
|
|
Join Date: May 2002
Location: Linghem, Östergötland, Sweden
Posts: 2,255
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: PHP Help Needed
I think this takes sleeping on.....
|

December 6th, 2003, 03:27 AM
|
 |
Shrapnel Fanatic
|
|
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
|
|
Re: PHP Help Needed
I fail to see a problem with this line:
array_multisort($fileArray, SORT_ASC, SORT_STRING);
|

December 6th, 2003, 03:32 AM
|
 |
Major General
|
|
Join Date: May 2002
Location: Linghem, Östergötland, Sweden
Posts: 2,255
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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!!
|

December 6th, 2003, 03:38 AM
|
 |
Major General
|
|
Join Date: May 2002
Location: Linghem, Östergötland, Sweden
Posts: 2,255
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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 ]
|

December 6th, 2003, 03:46 AM
|
 |
Shrapnel Fanatic
|
|
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
|
|
Re: PHP Help Needed
They are all lowercase to begin with.
|

December 6th, 2003, 04:15 AM
|
 |
Major General
|
|
Join Date: May 2002
Location: Linghem, Östergötland, Sweden
Posts: 2,255
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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 ]
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is On
|
|
|
|
|