Advertisement
Guest User

forumpasja

a guest
Feb 1st, 2019
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. <?php
  2.  
  3. $text_from_file_1 = fopen('1.txt', 'r') or die("Unable to open file!");
  4. $text_from_file_2 = fopen('2.txt', 'r') or die("Unable to open file!");
  5. $text_from_file_3 = fopen('3.txt', 'r') or die("Unable to open file!");
  6. $myfile = fopen("results.txt", "w") or die("Unable to open file!");
  7.  
  8. $pieces = explode("PHP_EOL", $text_from_file_1);
  9. $first = $pieces[0];
  10. $second = $pieces[1];
  11.  
  12. $content_from_file_2 = explode("PHP_EOL", $text_from_file_2);
  13. $content_from_file_3 = explode("PHP_EOL", $text_from_file_3);
  14.  
  15. $all_together = array_merge($content_from_file_2, $content_from_file_3);
  16.  
  17.  
  18. for($a = 0; $a < count($all_together); $a++) {
  19. echo $first."".$all_together[$a]."<br>";
  20. }
  21. for($b = 0; $b < count($all_together); $b++) {
  22. echo $second."".$all_together[$b]."<br>";
  23. }
  24.  
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement