if its a simple list, i personally just use array and put them in config file.
but if there will be an operation before displaying the string, like make it uppercase or anything, i would prefer enums, and put it in /app/Enums.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I need to translate some strings to other strings, not from one language to another.
Right now I have list of table names in the DB but the names don't always match and sometimes needs to be completely changed.
For example I get list of tables:
table1
table2
some_table3
And I want to have a file that translates them:
table1 -> My Table
table2 -> My Second Table
some_table3 -> One More Table
// and many more
or translate the column names of the tables themselves: (sort of dictionary)
x_col -> X Column
y_col -> The Y Column
// and many more
Should I use enum? Or just an array? And where do I place these files?
Please or to participate in this conversation.