Advertisement
John-E

Dual output

Apr 10th, 2022
1,213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.27 KB | None | 0 0
  1. <?php
  2.     if(file_exists($page_path)){
  3.         include($page_path);
  4.     }else{
  5.         ob_start("sanitize_all");}
  6. ?>
  7. ...HTML CODE...
  8. <?php
  9.     if(!file_exists($page_path)){
  10.         $fp = fopen($page_path, 'w');
  11.         fwrite($fp,ob_get_contents());
  12.         fclose($fp);
  13.         ob_end_flush();
  14.     }
  15. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement