define('key_start_atz', 200);
$str = 'key_start_atz';
如何通过200
获取$str
?
答案 0 :(得分:10)
constant($str);
答案 1 :(得分:3)
define('key_start_atz', 200);
$x = 'key_start_atz'; // contains 'key_start_atz'
$x = key_start_atz; // contains 200
$x = constant('key_start_atz'); // contains 200