Guest User

Untitled

a guest
May 21st, 2013
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.45 KB | None | 0 0
  1. <?php
  2.  
  3. function array_find($needle, $haystack)
  4. {
  5.    foreach ($haystack as $item)
  6.    {
  7.       if (strpos($item, $needle) !== FALSE)
  8.       {
  9.          return $item;
  10.          break;
  11.       }
  12.    }
  13. }
  14.  
  15. $archive = "test1.zip";
  16. $file = "file.txt";
  17. $search = "[email protected]";
  18.  
  19. $zip = new ZipArchive;
  20. if ($zip->open($archive) === TRUE) {
  21.     $data = file($file, FILE_IGNORE_NEW_LINES);
  22.     $zip->close();
  23. }
  24.  
  25. echo array_find($search, $data);
  26.  
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment