summaryrefslogtreecommitdiffstats
path: root/bio/vaje/1/programi/koliko.php
diff options
context:
space:
mode:
Diffstat (limited to 'bio/vaje/1/programi/koliko.php')
-rwxr-xr-xbio/vaje/1/programi/koliko.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/bio/vaje/1/programi/koliko.php b/bio/vaje/1/programi/koliko.php
new file mode 100755
index 0000000..6ec7933
--- /dev/null
+++ b/bio/vaje/1/programi/koliko.php
@@ -0,0 +1,16 @@
+#!/usr/bin/env php
+<?php
+ $d = file_get_contents("../urejeni.csv");
+ $e = explode("\n", $d);
+ $v = array();
+ foreach ($e as $f) {
+ $g = explode(",", $f);
+ $v[$g[$argv[1]]]++;
+ }
+ ksort($v);
+ foreach ($v as $k => $s) {
+ $p .= "$k,$s\n";
+ }
+ file_put_contents($argv[2], $p);
+ var_dump($v);
+?>