View difference between Paste ID: Y2kdaiyi and N3ZMAPqn
SHOW: | | - or go back to the newest paste.
1
<html>
2
 <head>
3
  <title>teszt</title>
4
  </head>
5
 <body>
6
<?php
7
if(($data=@file_get_contents('test.txt'))!==FALSE){
8
 foreach(explode(PHP_EOL,$data) as $line)if($line!=''){
9
  unset($split);
10-
  if(($split=explode(';',$line))!==FALSE)$tables[$split[0]][]=array((isset($split[1])?$split[1]:''),(isset($split[2])?$split[2]:''),(isset($split[3])?$split[3]:''));
10+
  if(count($split=explode(';',$line))>1)$tables[$split[0]][]=array_slice($split,1);
11
  }
12
 if(isset($tables))foreach($tables as $id => $table){
13
?>
14
  <table>
15
   <thead>
16
    <tr>
17
<?php echo '     <th colspan="3">Tábla '.$id.'</th>'.PHP_EOL; ?>
18
     </tr>
19
    </thead>
20
   <tbody>
21
<?php
22
 foreach($table as $line){
23
?>
24
    <tr>
25
<?php
26-
  foreach($line as $value)echo '     <td>'.$value.'</td>'.PHP_EOL;
26+
  foreach($line as $value)if($value!='')echo '     <td>'.$value.'</td>'.PHP_EOL;
27
?>
28
     </tr>
29
<?php
30
  }
31
?>
32
    </tbody>
33
   </table>
34
  <br />
35
<?php
36
  }
37
 }
38
?>
39
  </body>
40
 </html>