FOSSology  4.4.0
Open Source License Compliance by Open Source Software
unique.php
1 #!/usr/bin/php
2 <?php
3 /*
4  SPDX-FileCopyrightText: © 2014 Hewlett-Packard Development Company, L.P.
5 
6  SPDX-License-Identifier: GPL-2.0-only
7 */
13 if ($argc < 2 || empty($argv[1])) {
14  print "please specify the file you want to parse.\n";
15  exit;
16 }
17 
18 //print "scanning_file is:$scanning_file\n";
19 $scanning_file = $argv[1];
20 $lines = file($scanning_file);
21 $count1 = count($lines);
22 $lines = array_unique($lines);
23 $count2 = count($lines);
24 file_put_contents($scanning_file, implode('', $lines));