View Single Post
  #2 (permalink)  
Old 08-19-06, 05:35 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community VIP
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 2,724
Thanks: 0
Thanked 0 Times in 0 Posts
possible answers to your questions:
1. you could split the search-query, by using the whitespace. then you have to loop over the search-options, during the foreach loop:
PHP Code:
$search explode(' '$search);
 foreach (
$file as $line => $data)
{
    list(
$month$day$year$info) = explode('|'trim($data) );
    for(
$i=0$i<sizeof($seach); $i++){
      if (
stristr($info$search[$i]))
      {
      echo 
$info;
      }
    }

2. instead of overwriting the same variables (list($month, $day, $year, $info)), you have to use them as an array. then use the sort() function to sort the array. This way you will have to double loop over your data, as you can't display for the search query an sort the array at the same time. then the year wouldn't be displayed ordered.

3. Do you mean newlines or just whitespace? if it's just whitespace, use the str_replace function to replace ' ' by '&nbsp;', then there should be no problem. if it's newlines, then i have no idea.

Greetz,
UnrealEd
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

If you want to add me on any IM, pm me first
Reply With Quote