//定界符
$a = "www.jb51.net";
$var = "ghj";
print <<< jb51
<select>
<option value="1">第一项</option>
</select>
这里是{$var}的php教程
jb51;
var_dump('$\');
$test = "www.jb51.net";
var_dump("${test}");
//unset使用
function foo(&$bar) {
unset($bar);
$bar = "blah";
}
$bar = '123';
echo "$bar
";
foo($bar);
echo "$bar
";
//数组循环$k[$v])
$arr = array('abc'=>1,'def'=>2,'ghjp'=>3);
foreach ($arr as $k=>$v)
{
var_dump($k[$v]);
//string(1) "b" string(1) "f" string(1) "p"
}
/*
* 交换数值
* 该函数只用于数字索引的数组,且假定数字索引从 0开始
* */
$num='abc';//交换成ddd
$num2="ddd";//交换成abc
list($num,$num2)=[$num2,$num];