参数 | 描述 |
---|---|
phpcode | 必需。规定要计算的 PHP 代码。 |
注释:返回语句会立即终止对字符串的计算。
注释:该函数对于在数据库文本字段中供日后计算而进行的代码存储很有用。
<?php
$string = "beautiful";
$time = "winter";
$str = This is a $string $time morning!;
echo $str. "<br />";
eval("\$str = \"$str\";");
echo $str;
?>
输出:
This is a $string $time morning! This is a beautiful winter morning!
制作:
http://www.7di.net 生活网搜集整理 参考: http://www.w3school.com.cn/php/func_misc_eval.asp |