How can I do that?
我怎样才能做到这一点?
I have something like:
我有类似的东西:
define($stuff.'_FOO', 'whatever');
echo $stuff.'_FOO';
and it doesn't work :(
它不起作用:(
I just want to echo the constant's value...
我只想回应常数的价值......
2 个解决方案
#2
8
First make a constant:
先做一个常数:
define("FOO_BAR", "something more");
then you can get the value by using constant()
:
然后你可以使用constant()来获取值:
echo constant("FOO_BAR");
Read more about constants in the manual.
阅读手册中有关常量的更多信息。
#1
#2
8
First make a constant:
先做一个常数:
define("FOO_BAR", "something more");
then you can get the value by using constant()
:
然后你可以使用constant()来获取值:
echo constant("FOO_BAR");
Read more about constants in the manual.
阅读手册中有关常量的更多信息。