List of countries, categories etc

I have a list of countries, categories, cities etc. stored in arrays. What is the most common way to store those lists. Do I need to create extra php file lists.php where I put all arrays ($countries, $category,… and than I call this file in main file? Or is it ok to simply include this in functions.php inside function getCategoryList.

And is there any huge difference if I use int or varchar for countries, categories etc in searches?

Thank you

Both arrays and MySQL have their merits.
Arrays are way faster then using MySQL, but if you want to show for example the country for each user (assuming you have users) you can simply do that by means of a JOIN in MySQL, whereas you need extra PHP logic if you use an array.

If there is no CRUD operation related to countries and categories and if they are used just for looping or accessing purposes then arrays are fine. I think so.

Are you sure MySql is better solution? The data are static.

A common way to store data like that is to use an xml file but arrays seems fine. The primary issue you run into is if that data needs to be merged with data stored in MySQL for example number of people per country. In that case it would be better to place the countries in MySQL. I know I mentioned earlier arrays are ok but the categories should be stored in MySQL because those are application dependent where as countries are relatively continuous in nature similar to states.

Store it in a database. Check MySQL .