Advertisement
Guest User

Untitled

a guest
May 24th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. <?php
  2.  
  3. $string = file_get_contents("sample-file.txt");
  4. $found = false;
  5. $n = 0;
  6. do {
  7.  
  8. $found = (strpos($string, 'eval') !== false);
  9.  
  10. if ($found) {
  11. ob_start();
  12. eval(str_replace("eval", "print", $string));
  13. $string = ob_get_clean();
  14. }
  15.  
  16. $n++;
  17. } while ($found);
  18.  
  19. //echo $n;
  20. //print $string;
  21. file_put_contents ("result.php", $string);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement