You can use an array instead a global variable if you have to keep many values.
If you plan on making a multiplayer games, you will have to keep the data on a server, the date can file can be anything from json, XML or MySQL. But I suggest using a MySQL database, because its secure and its made to handle more requests at the same time.
You will need to find tutorials how to link construct 2 file to MySQL, because its not easy as it seems.