Advertisement
Guest User

Untitled

a guest
Nov 21st, 2017
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.51 KB | None | 0 0
  1.             <?php
  2.                 $file = fopen("test.txt","r"); // pobranie pliku o nazwie test.txt
  3.                 $linecount = 0;    
  4.                 while(! feof($file))
  5.                 {
  6.                 $linecount++;
  7.                
  8.                 if ($linecount == 1)
  9.                 continue;
  10.                 if($linecount == 200)
  11.                 break;
  12.  
  13.                 echo "<tr>";
  14.                 $line = fgets($file);
  15.                 $cols = explode('|', trim($line, '|'));
  16.                 $last_item = array_pop($cols);
  17.                 $first_item = array_shift($cols);
  18.                 foreach($cols as $col)
  19.                 echo "<td>$col</td>";
  20.                 echo "</tr>";
  21.                 }
  22.                 fclose($file);
  23.             ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement