开发者

Making global var from string in PHP?

开发者 https://www.devze.com 2023-02-09 15:55 出处:网络
For example^ $locale = \'locale_array\'.$开发者_StackOverflow中文版locale; global $$locale -? $GLOBALS[\'locale_array\'.$locale]

For example^

  $locale = 'locale_array'.$开发者_StackOverflow中文版locale;
  global $$locale -?


$GLOBALS['locale_array'.$locale]


you can use session variables also. dont know if you need.

session_start('SID'); // important: use in every file you need the session vars
$_SESSION['loc'] = 'locale_array'.$locale;
0

精彩评论

暂无评论...
验证码 换一张
取 消