Forum Moderators: coopster

Message Too Old, No Replies

Ordering Data from a Flat Text File!

         

dreamcatcher

7:05 am on Mar 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Can I order data that is stored in a flat text file? I assume I can, but I`m not that familiar with text file databases.

I`m using the following to display the text file info:

$loadfile = @file($datafile);
$count = sizeof($loadfile);

for ($i=0; $i<$count; $i++)

{

list ($date, $ip, $name, $email, $link, $size) = explode("¦", $loadfile[$i]);

echo stuff.....

}

If I wanted to order the information by date, how would I go about that?

Thank you.

coopster

12:56 pm on Mar 3, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



When you said ordering data I thought you meant you wanted to fill a shopping cart with data!

:) hehe.

I think you are asking "How can I sort flat text file data?" and if I am correct, will the technique used in Sorting fgetcsv information [webmasterworld.com] work for you?

dreamcatcher

5:26 pm on Mar 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



When you said ordering data I thought you meant you wanted to fill a shopping cart with data!

LOL! Thanks for putting a smile on my face after a crappy day at work. :)

And thanks for the info coopster, I`ll give that a try!