Guest User

Untitled

a guest
Nov 25th, 2015
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $CSV = fopen("input.csv", "r");
  2.  
  3. if($CSV !== FALSE)
  4.  
  5. {
  6.     $dlc = [];
  7.     while(! feof($CSV))
  8.         {
  9.         $data = fgetcsv($CSV, 1000, ";");
  10.         $result = preg_match_all("/DLC-[A-Z0-9]+/s", $data[20], $output_array);
  11.         if($result) {
  12.                 $dlc = array_merge($dlc, $output_array[0]);
  13.         }
  14.     }
  15. }
  16.  
  17. fclose($CSV);
  18.  
  19. $dlc = array_unique($dlc);
  20. var_dump($dlc);
Advertisement
Add Comment
Please, Sign In to add comment