Advertisement
szabozoltan69

6+2 ragasztás

Aug 9th, 2012
131
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. //php ragaszd.php   > /tmp/kimenet
  3.  
  4. define('d',",");
  5. define('n',"\n");
  6. $f_=file('f1',FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); // f1 - 6oszl
  7. $g_=file('f2',FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); // f2 - 2oszl
  8.  
  9.  
  10. foreach($f_ as $i=>$f){
  11.     $x=explode(d,$f);
  12.     $y=explode(d,$g_[$i]);
  13.     print $f.($x[1]==$y[0]?$g_[$i]:'').n;
  14. }
  15. ?>
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement