Home  >  Article  >  Backend Development  >  php-PHP如何在echo输出时,再解析变量?

php-PHP如何在echo输出时,再解析变量?

WBOY
WBOYOriginal
2016-06-02 11:28:481171browse

php

举个栗子吧:
$a="abc{$xxx}abc";
$xxx="666";
echo $a;
?>
以上代码不成立,不能得到预期的"abc666abc"
检查代码后,个人认为是变量"$xxx"在第一行就已经被解析了,
但是在第一行"$xxx"没有定义,所以得不到值
如何让变量在输出时再解析这个"$xxx"变量,得到这个"abc666abc"呢?

在线等,希望路过的大神不要吝啬赐教,在下感激不禁!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn