如何让数据库字段中的php代码运行?
如何让数据库字段中的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!