@@ -0,0 +1,29 @@
+This script can be fed a file with list of comma-separated values, and will output unique items (ie. remove repetitive ones).
+
+Input file **must** be properly formatted, no extraneous lines or unwanted whitespace.
+## Example Input File ##
+**values.txt**
+```
+2016,2018,2018,2019,2018,2018,2018,2019,2016,2017,2014,2017,2019,2018,2014,2014,2017,2016,2014,2018,2017,2017,2014,2019,2015,2019,2019,2013,2013,2016,2019,2017,2019,2014,2017,2019
+## Example Run ##
+$> php get-unique-items.php values.txt
+## Example Output ##
+ Results
+ =========================
+ 2016
+ 2018
+ 2019
+ 2017
+ 2014
+ 2015
+ 2013
@@ -12,7 +12,6 @@ if (isset($argv[1])){
$input = fread($input_file, filesize($argv[1]));
fclose($input_file);
-
$values = explode(',', $input);
$unique = array();
@@ -27,6 +26,8 @@ if (isset($argv[1])){
foreach ($unique as $u){
echo " " . $u . "\n";
}
+ return 0;
else{