Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 135,916 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 2,595 people online right now. Registration is fast and FREE... Join Now!




Sorting Directory

 
Reply to this topicStart new topic

Sorting Directory

fyrestorm
19 Sep, 2002 - 12:45 PM
Post #1

D.I.C Lover
Group Icon

Joined: 4 Apr, 2002
Posts: 3,103



Thanked: 2 times
Dream Kudos: 228
My Contributions
is there a way to sort the files in a directory?
User is offlineProfile CardPM
+Quote Post

skyhawk133
RE: Sorting Directory
19 Sep, 2002 - 12:51 PM
Post #2

Head DIC Head
Group Icon

Joined: 17 Mar, 2001
Posts: 14,919



Thanked: 47 times
Dream Kudos: 1650
Expert In: Web Development

My Contributions
on the server? when displaying? how do you mean...

if you find out, it would be handy for our newsletter area smile.gif
User is online!Profile CardPM
+Quote Post

Spider
RE: Sorting Directory
19 Sep, 2002 - 01:18 PM
Post #3

Arachnid
****

Joined: 10 Jul, 2002
Posts: 769


My Contributions
just wondering, when you pull out the filenames for your newsletter, are they stored as an array, or does the code grab each file individually?

either way, if you could put the filenames in an array sorting would be simple smile.gif
User is offlineProfile CardPM
+Quote Post

fyrestorm
RE: Sorting Directory
19 Sep, 2002 - 01:47 PM
Post #4

D.I.C Lover
Group Icon

Joined: 4 Apr, 2002
Posts: 3,103



Thanked: 2 times
Dream Kudos: 228
My Contributions
QUOTE(Spider @ Sep 19 2002, 03:18 PM)
just wondering, when you pull out the filenames for your newsletter, are they stored as an array, or does the code grab each file individually?

either way, if you could put the filenames in an array sorting would be simple smile.gif

it grabs each file individually, wanna tell us how to make a sorting array?
User is offlineProfile CardPM
+Quote Post

skyhawk133
RE: Sorting Directory
19 Sep, 2002 - 01:54 PM
Post #5

Head DIC Head
Group Icon

Joined: 17 Mar, 2001
Posts: 14,919



Thanked: 47 times
Dream Kudos: 1650
Expert In: Web Development

My Contributions
I don't have the code handy and no motivation to write it, but if you just loop through while it pulls the filenames, instead of printing them, you'll add them to an array, then there is a sort($array_name) or something like that smile.gif

I know... that helped absolutley nothing!
User is online!Profile CardPM
+Quote Post

fyrestorm
RE: Sorting Directory
19 Sep, 2002 - 02:08 PM
Post #6

D.I.C Lover
Group Icon

Joined: 4 Apr, 2002
Posts: 3,103



Thanked: 2 times
Dream Kudos: 228
My Contributions
actually that's enough information to get me motivated smile.gif

and actually, after looking in the directory, i shouldn't have to sort it because it's already sorted, why it's pulling the filenames in an off balanced order i have no clue...
User is offlineProfile CardPM
+Quote Post

Spider
RE: Sorting Directory
20 Sep, 2002 - 07:16 AM
Post #7

Arachnid
****

Joined: 10 Jul, 2002
Posts: 769


My Contributions
it may well be pulling them out in date order or something, or maybe it's just being random to annoy you tongue.gif

and yes, there is a simple sort($array_name) function, which would suit you nicely I think, you just need to write something to put all the filenames in an array smile.gif
User is offlineProfile CardPM
+Quote Post

fyrestorm
RE: Sorting Directory
20 Sep, 2002 - 08:20 AM
Post #8

D.I.C Lover
Group Icon

Joined: 4 Apr, 2002
Posts: 3,103



Thanked: 2 times
Dream Kudos: 228
My Contributions
ah, it's easy to write an array, so now that i know about sort() it's all good, thanks spider smile.gif
User is offlineProfile CardPM
+Quote Post

Mark Elliot
RE: Sorting Directory
21 Sep, 2002 - 06:17 PM
Post #9

New D.I.C Head
*

Joined: 16 Sep, 2002
Posts: 7

read the files into an array -- here. there's all kinds of manipulation functions..
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/1/08 07:59AM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month