Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $f1 = file('file1.txt');
- $f2 = file('file2.txt');
- $new_data = array();
- foreach ($f2 as $entry) {
- $data = explode(':', $entry);
- if (!in_array($data[0], $f1) {
- $new_data[] = $entry;
- }
- }
- $f3 = fopen('file2.txt', 'w+');
- fwrite($f3, implode(PHP_EOL, $new_data);
- fclose($f3);
Add Comment
Please, Sign In to add comment