Created
June 7, 2014 11:14
-
-
Save anonymous/1a8134838b06ae1bfd17 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $sourcefile = fopen('word.txt', 'r'); | |
| while (!feof($sourcefile)){ | |
| $cursymbol = fread($sourcefile, 1); | |
| if ($cursymbol != " "){ | |
| $word = $word . $cursymbol; | |
| } else { | |
| $words[$word] += 1; | |
| $word = null; | |
| } | |
| } | |
| foreach ($words as $brand => $count) { | |
| echo $brand . ' - ' . $count . '; '; | |
| } | |
| fclose($sourcefile); | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mac mac word ibm mac pc mac mac mac power mac ibm power |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment