I am trying to create a string literal file for PHP, so I can store all my strings in a single file.
I was wondering if it would be good practice to do something like:
class Literals
{
const String1 = "Hello";
const String2 = "World!";
}
And then somewhere in my code I could call it like this:
$hello = Literals::String1;
Is this a good practice?
chris source
share