Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>teszt</title>
- </head>
- <body>
- <?php
- if(($data=@file_get_contents('test.txt'))!==FALSE){
- foreach(explode(PHP_EOL,$data) as $line)if($line!=''){
- unset($split);
- if(count($split=explode(';',$line))>1)$tables[$split[0]][]=array_slice($split,1);
- }
- if(isset($tables))foreach($tables as $id => $table){
- ?>
- <table>
- <thead>
- <tr>
- <?php echo ' <th colspan="3">Tábla '.$id.'</th>'.PHP_EOL; ?>
- </tr>
- </thead>
- <tbody>
- <?php
- foreach($table as $line){
- ?>
- <tr>
- <?php
- foreach($line as $value)if($value!='')echo ' <td>'.$value.'</td>'.PHP_EOL;
- ?>
- </tr>
- <?php
- }
- ?>
- </tbody>
- </table>
- <br />
- <?php
- }
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement