<?
 
  include("textdb.php");
 
  
 
  $test = New textDB("test.txt", 1);
 
?>
 
Raw unsorted records<br>
 
<?
 
  $record = $test->first();
 
  while ($record)
 
  {
 
    echo $record[id]." ".$record[label]."<br>";
 
    $record = $test->next();
 
  }
 
?>
 
<br><br>Sort in ascending order<br>
 
<?
 
 
  $test->sort("A");
 
  
 
  $record = $test->first();
 
  while ($record)
 
  {
 
    echo $record[id]." ".$record[label]." ".$record[text]."<br>";
 
    $record = $test->next();
 
  }
 
?>
 
<br><br>Sort in descending order<br>
 
<?
 
  $test->sort("D");
 
  
 
  $record = $test->first();
 
  while ($record)
 
  {
 
    echo $record[id]." ".$record[label]." ".$record[text]."<br>";
 
    $record = $test->next();
 
  }
 
?>
 
<br><br>No sortering<br>
 
<?
 
  $test->sort();
 
  
 
  $record = $test->first();
 
  while ($record)
 
  {
 
    echo $record[id]." ".$record[label]." ".$record[text]."<br>";
 
    $record = $test->next();
 
  }
 
?>
 
 
 |