Variable Problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Telos
Forum Commoner
Posts: 37
Joined: Sat Aug 02, 2003 9:03 am
Location: Finland

Variable Problem

Post by Telos »

I have some problems with variables. I have a class and then I have a language.php file and I include the class file and the language file in index.php file. Now I have this in language file:

Code: Select all

$lang_time = 'Time';
and when I try to echo the $lang_time variable in the index file it works ok and I get "Time" as a result but when I try to echo it inside one of the class's functions I don't get nothing. How can I make it like it would work there too?
Telos
Forum Commoner
Posts: 37
Joined: Sat Aug 02, 2003 9:03 am
Location: Finland

Post by Telos »

ok, I found one solution. I just changed the variables in language.php file into this

Code: Select all

define(lang_time, 'Time');
and that works ok. Just would like to know if that's a good idea or what?
Post Reply