Re: define variables.

From: Date: Wed, 05 Mar 2003 17:59:01 +0000
Subject: Re: define variables.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-138326@lists.php.net to get a copy of this message
http://www.php.net/manual/en/function.constant.php $msg = constant('_LANG'.$num); HTH, -- Jason k Larson Vincent M. wrote:
Hello, I do a lot of define like that: define ("_LANG1", "Server options"); define ("_LANG1", "Manage your system"); etc... And stuff like that: if($num == 1) {
    $mgs = _LANG1 ;
}else if($num == 2) {
    $mgs = _LANG2 ;
} etc... But I do want to avoid all these if and else, is there a way to do something like that: $mgs = _LANG.$num ; ? Thanks.


« previous php.general (#138326) next »