OK. So you have these 4 pages with lists of words on them, and you want to add to the lists, resort and count them.
So, you need the filesystem functions to open each html file and read it in.
Then you need the string funstions to extract your list from the rest of the page. I would use an html comment as a marker for the beginning and end of the lists. Then strpos() will tell you where to cut the string using substr() to leave just the list.
Then you need the array functions . Explode() the list string into an array, add the new word, sort the array with asort(), implode() it back into a string, add the html you cut off from the ends and save the edited file.
Edit: Looking back, you could use explode() to break the page into an array of 3 strings using your markers; the middle member would be your word list which you then explode into an array of words. Simpler than strpos and substr, both to cut up the page and then to reassemble it when finished.