You probably want to create a map, which allows you to associate keys and values - you can use your strings as the keys and their counts as the values. See the
documentation about maps. Obviously you'll need to get a list of all the strings in your file first. As far as actually reading from a file goes, you'll probably want to use fopen() and fread() to do that. Again see the PHP documentation for information on these functions.