Guest User

Untitled

a guest
Jul 22nd, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. <?php
  2. require_once 'stdlib.php';
  3.  
  4. $file = '/tmp/bommed.out';
  5.  
  6. function boms_away($file = '/tmp/bommed.out')
  7. {
  8. $fp = fopen($file, "w");
  9. fwrite($fp, pack("CCC", 0xef, 0xbb, 0xbf));
  10. fclose($fp);
  11. }
  12.  
  13. boms_away($file);
  14. $fh = fopen($file, 'r');
  15. $data = fread($fh, filesize($file));
  16. fclose($fh);
  17.  
  18. $m = new Mongo("mongodb://localhost:27017");
  19. $db = $m->test;
  20. $coll = $db->test;
  21. $coll->insert($data);
  22. ?>
Add Comment
Please, Sign In to add comment