21,886
社区成员
发帖
与我相关
我的任务
分享
$hh = const(hello);
确实,加一个 const就可以了。
<?php
header("Content-Type: text/html;charset=utf-8");
define('warn', 0);
define('hello', 2);
define('haha', 3);
$name = 'hello';
$hh = const(hello);
var_dump($hh);
?>
加一个 const就可以了
<?php
header("Content-Type: text/html;charset=utf-8");
define('warn', 0);
define('hello', 2);
define('haha', 3);
$name = 'hello';
$hh = hello;
var_dump($hh);
?>
如何将以上程序中 $name的效果 变成和 $hh ,一样的效果