类中的变量变量 [英] Variable Variables in Classes
本文介绍了类中的变量变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
类示例{
var $ Stage;
函数示例(){
$ this-> Stage = ''init'';
$ x = ???????;
echo $$ x;
}
}
我在$ x中放入什么以便$$ x给我init? ''舞台''不起作用,
也不是'' - >舞台''。
-
Alan Little
Phorm PHP表格处理器
http: //www.phorm.com/
class example {
var $Stage;
function example() {
$this->Stage = ''init'';
$x = ???????;
echo $$x;
}
}
What do I put in $x so that $$x gives me "init"? ''Stage'' doesn''t work,
nor does ''this->Stage''.
--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
推荐答案
阶段;
函数示例( ){
Stage;
function example() {
this-> Stage =''init'';
this->Stage = ''init'';
x = ???????;
echo
x = ???????;
echo
这篇关于类中的变量变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文