Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function array_find($needle, $haystack)
- {
- foreach ($haystack as $item)
- {
- if (strpos($item, $needle) !== FALSE)
- {
- return $item;
- break;
- }
- }
- }
- $archive = "test1.zip";
- $file = "file.txt";
- $zip = new ZipArchive;
- if ($zip->open($archive) === TRUE) {
- $data = file($file, FILE_IGNORE_NEW_LINES);
- $zip->close();
- }
- echo array_find($search, $data);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment