Week 2 – Word counting
Write a two (or more) page web site which will display details of how often selected words appear in a
text file read from the server.
Use a form to submit the following details:
; Name of the text file
; Type of display ( optional), e.g. word map, count, pictogram
; Up to 10 words to search for
Display an error if:
; The file does not exist
; There are less than 3 words
; Any of the words contain spaces
Display a representation(s) of the count of the words:
; Table of numbers
; Word map
1. The example code in complex_form.php shows the type of form you will have to use
2. One way to count the words is to use the string function call substr_count($data, $word).
3. You could use the file_get_contents() to read the text from the file.