Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $text_from_file_1 = fopen('1.txt', 'r') or die("Unable to open file!");
- $text_from_file_2 = fopen('2.txt', 'r') or die("Unable to open file!");
- $text_from_file_3 = fopen('3.txt', 'r') or die("Unable to open file!");
- $myfile = fopen("results.txt", "w") or die("Unable to open file!");
- $pieces = explode("PHP_EOL", $text_from_file_1);
- $first = $pieces[0];
- $second = $pieces[1];
- $content_from_file_2 = explode("PHP_EOL", $text_from_file_2);
- $content_from_file_3 = explode("PHP_EOL", $text_from_file_3);
- $all_together = array_merge($content_from_file_2, $content_from_file_3);
- for($a = 0; $a < count($all_together); $a++) {
- echo $first."".$all_together[$a]."<br>";
- }
- for($b = 0; $b < count($all_together); $b++) {
- echo $second."".$all_together[$b]."<br>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement