projects
/
uwc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d238381
)
uwc: php implementation
author
Neszt Tibor
<neszt@tvnetwork.hu>
Tue, 30 Sep 2014 13:27:35 +0000
(15:27 +0200)
committer
Neszt Tibor
<neszt@tvnetwork.hu>
Tue, 30 Sep 2014 13:27:35 +0000
(15:27 +0200)
uwc.php
[new file with mode: 0644]
patch
|
blob
diff --git a/uwc.php
b/uwc.php
new file mode 100644
(file)
index 0000000..
43d8995
--- /dev/null
+++ b/
uwc.php
@@ -0,0
+1,22
@@
+<?php
+
+$res = array();
+
+while($f = fgets(STDIN)){
+ preg_match_all("/([a-z']+)/i", $f, $matches, PREG_SET_ORDER);
+ foreach ($matches as $k => $v) {
+ if ( !isset($res[$v[0]]) ) {
+ $res[$v[0]] = 1;
+ } else {
+ $res[$v[0]]++;
+ }
+ }
+}
+
+asort($res);
+
+foreach ( $res as $k => $v ) {
+ print "$k $v\n";
+}
+
+?>