php 中双引号常量替换
in php - Hits()
php双引号字符串中可计算变量表达式,但是常量怎么办,可以使用如下方法:
define('ANIMAL', 'dog');
$constant = 'constant';
echo "I like {$constant('ANIMAL')}";in php - Hits()
php双引号字符串中可计算变量表达式,但是常量怎么办,可以使用如下方法:
define('ANIMAL', 'dog');
$constant = 'constant';
echo "I like {$constant('ANIMAL')}";