标签:
1 <?php 2 $a = array(); 3 $a[0] = 1; 4 $a[1] = 2; 5 $b = (object)$a; 6 var_dump($b);
怎么从对象$b 中取值???
1 <?php 2 $m = ‘3‘; 3 $$m = 111; 4 echo $$m;
为何数字可以做为变量????
---------- php ----------
class stdClass#1 (2) {
int(1)
int(2)
}
111
输出完成 (耗时 0 秒) - 正常终止
标签:
原文地址:http://www.cnblogs.com/sanshuiqing/p/4758163.html