正常的php代码怎么写,eval()里面就怎么写,
其中的变量:$Type $id $Topic $Writer $postTime,最好前后加上{},例如{$id}<?php
$string = 'cup';
$name = 'coffee';
$str = 'This is a {$string} with my {$name} in it.';
echo $str. "\n";
eval("\$str = \"$str\";");
echo $str. "\n";
?>
其中的变量:$Type $id $Topic $Writer $postTime,最好前后加上{},例如{$id}<?php
$string = 'cup';
$name = 'coffee';
$str = 'This is a {$string} with my {$name} in it.';
echo $str. "\n";
eval("\$str = \"$str\";");
echo $str. "\n";
?>
$caption='文学客网刊';
$str='| <a href=\"http://www.wxbk.com/wangk.htm\">$caption</a>';
eval("\$str;");
?>
为什么以上的代码没有效果?没有显示"|文学客网刊'"
eval("\$str = \"$str\";");