eval
作用: 把字符串作为PHP代码执行
说明:
mixed eval ( string $code )
$string = 'cup';
$name = 'coffee';
$str = 'This is a $string with my $name in it.';
echo $str."</br>";
eval("\$str = \"$str\";");
echo $str."\n";
输出结果:
This is a $string with my $name in it.
This is a cup with my coffee in it.