Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $link = $_SERVER['REQUEST_URI'];
- $file = explode('/', $link);
- $add_tab = 0;
- include 'header.html';
- foreach($file as $f)
- {
- $path = $f;
- if(strpos($path, ".php") !== false)
- {
- $opened_file = fopen($path, "r");
- while(!feof($opened_file))
- {
- $read_file = fgets($opened_file);
- $line = htmlspecialchars($read_file);
- if(strpos($line, "}") !== false && $add_tab > 0) $add_tab--;
- if($add_tab > 0)
- {
- $i=0;
- while($i<$add_tab)
- {
- echo '<span class="tab">___</span>';
- $i++;
- }
- }
- $line = str_replace("'if",'<span class="noif">\'if</span>', $line);
- $line = str_replace('if(', '<span class="if">if</span>(', $line);
- $line = str_replace("'foreach",'<span class="noif">\'foreach</span>', $line);
- $line = str_replace('foreach(', '<span class="foreach">foreach</span>(', $line);
- $line = str_replace("'while",'<span class="noif">\'while</span>', $line);
- $line = str_replace('while(', '<span class="while">while</span>(', $line);
- echo $line . "\n<br/>";
- if(strpos($line, "{") !== false) $add_tab++;
- }
- echo "\n<br/>";
- fclose($opened_file);
- }
- }
- include 'footer.html';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment