标签:style http ar color os 使用 sp on div
可变变量:就是说一个可变变量 获取了一个普通变量的值 作为这个可变变量的变量名。例如:<?php
header("content-type:text/html;charset=utf-8");
$uername = ‘村里有个姑娘‘;
$name = ‘xiaofang‘;
$xiaofang = ‘大阪城的姑娘‘;
//$$name =$xiaofang
echo $$name;
//可变变量的用法
$banzhuren = ‘xucaihui‘;
$xucaihui = ‘man‘;
$man = ‘lvyou‘;
$lvyou = ‘taiguo‘;
$taiguo = ‘是女的‘;
echo $$$$$banzhuren;
输出结果:大阪城的姑娘是女的
<?php
$user = ‘canglaoshi‘;
$name = ‘wulaoshi‘;
//使$name的值指向$user,并且丢弃$name的值
$name =&$user;
echo $name;
echo ‘<br />‘;
echo $user;
//判断结果是否相同,结果都是10个字节的字符串
if(empty($name)){
echo ‘kong‘;
}else{
echo ‘feikong‘;
};
echo ‘<br/>‘;
var_dump($user);
echo ‘<br/>‘;
var_dump($name);
echo ‘<br/>‘;
//销毁变量$user, $name的输出结果仍然是canglaoshi,足以证明内存中只剩下一个值
unset($user);
echo ‘<br/>‘;
echo $name;
echo $user;
输出结果:
canglaoshi
canglaoshifeikong
string(10) "canglaoshi"
string(10) "canglaoshi"
canglaoshi
Notice: Undefined variable: user in D:\xampp\htdocs\89\Exercise\2014-7-25 PHP kongzhiyuju\01yinyon.php on line 29
标签:style http ar color os 使用 sp on div
原文地址:http://www.cnblogs.com/lxw89/p/f03c807174caf4ad69f178a49cb28445.html