Display text files in order

This is a discussion on "Display text files in order" within the PHP Forum section. This forum, and the thread "Display text files in order are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Oct 22nd, 2007, 01:32
New Member
Join Date: Oct 2007
Location: surrey
Age: 26
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Display text files in order

Hi everyone,

I have a web site that displays prices of hotels on it. These prices are stored in separate text files so that they can be edited and displayed (using the php "include" statement) on the web page that they are supposed to be displayed on. Right now each hotel has it's own individual page where they can advertise. However, I would like to make an additional page that lists the top 10 cheapest hotels of the day. Since the prices (contained in the text files) will change all the time, this list will change all the time. I know that I can display all the prices on one page, but how do I make it so that the prices are displayed in order from lowest to highest. Is there some type of javascript code or php code that I could use to do this? Please help. I am a relative beginner and would welcome any code or help that you can provide.

Thanks
Reply With Quote

  #2 (permalink)  
Old Oct 22nd, 2007, 04:10
c010depunkk's Avatar
SuperMember

SuperMember
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 593
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to c010depunkk
Re: Display text files in order

Forget javascript for this, PHP is the way to go here.
@mod: move to PHP please

If you have all the prices in an array then you can use the array sorting functions. For example natcasesort.... there's lots more.
Reply With Quote
  #3 (permalink)  
Old Oct 22nd, 2007, 13:48
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Display text files in order

Quote:
Originally Posted by c010depunkk View Post
@mod: move to PHP please
Moved!
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
display text elmasduro JavaScript Forum 0 Apr 27th, 2007 04:07
Possible to update content through text files? jwilliams31 Web Page Design 14 Nov 25th, 2006 23:12
Different Text Display in Different Browser ??? j4mes_bond25 Web Page Design 0 Jul 6th, 2006 17:26
Directory of files not in alphabetical order dkintheuk PHP Forum 5 Dec 16th, 2005 09:34
Databases and Text Files chris123 Databases 2 Jun 6th, 2005 18:06


All times are GMT. The time now is 11:47.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43