Home >Backend Development >PHP Tutorial >php的代码输出问

php的代码输出问

WBOY
WBOYOriginal
2016-06-23 13:19:49885browse

假设 
$alipay = '支付宝';
$b = 'alipay';

echo $$b;  却不能输出支付宝 该怎么输出?


回复讨论(解决方案)

我这里能输出,你的php版本是多少?

或者试试 echo ${$b};

目测写法没有问题

$alipay = '支付宝';$b = 'alipay';echo $$b;

我的正常,没问题。

我的也正常,没有问题。

我擦 正常的 

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
Previous article:PHP 日期函数说明Next article:PHP的魔法方法