Guest User

Untitled

a guest
Mar 13th, 2018
77
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=file_get_contents('./data/today');
  3.     $entries=explode('##START',$file);
  4.     $i=1;
  5.     foreach($entries as $entry){
  6.         $lines=explode("\n", $entry);
  7.         var_dump($lines); // Diagnostics!
  8.         if($lines[1]!=''){
  9.             echo('<h2 class=today id='.$i.'>'.$lines[1].' - '.$lines[2].'</h2>');
  10.             if(!preg_match('/##NSH/',$lines[3])){
  11.                 array_shift($lines);
  12.                 array_shift($lines);
  13.                 array_shift($lines);
  14.                 echo('<p>');
  15.                 echo(implode('<br/>',$lines));
  16.                 echo('</p><br/>');
  17.             }
  18.             $i=$i+1;
  19.         }
  20.     }
  21. ?>
Add Comment
Please, Sign In to add comment