Hi,
I´m trying to use some constans in my program and I don´t want to use as globlas one. I´ve thought that is posible keep then in an array that takes part from a class, so I would have (commands.php)
class commands {
var $comandos = array ("LOGIN_USER" => 1,
"NEW_USER" => 2);
function commands() {
}
}
So, I´m in myprogram.php, and I want to access to the value of LOGIN_USER, I have to do:
require("./commands.php");
$h = new commands;
$p = $h->comandos[LOGIN_USER];
I need to invoke 'new' as it was to expect. My question is the next one:
Is there any way no to invoke 'new' and to access to the variable commands?. Or, is there any other way to implement what I want to do?
Thanks,