use file() instead of file_get_contents() and preg_split()
trim both key & value