标签: php variables eval
例如,如果我有这个PHP代码
$template = 'A = {$a}, b = {$b}'; $a = "A"; $b = "B"; eval("\$output = \"".$template."\";"); echo $output;
结果为A = A, b = B。但如果我不希望eval()解析var $ b(不使用unset()),我该怎么办?
A = A, b = B