我在 PHP 中定义了一个常量,例如
define('CONSTANT_NAME', 'constant_value');
我希望稍后能够在代码中更改此常量的值。
这可以吗?如果有,怎么做?
最佳答案
来自 http://php.net/manual/en/function.define.php (重点是我的):
define
— Defines a named constant
来自 http://www.php.net/manual/en/language.constants.php :
As the name suggests, that value cannot change during the execution of the script
关于php - 更改先前定义的常量的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8481869/