我收到以下错误:
解析错误:语法错误,eval()代码中意外的“预订”(T_STRING)。
这是我的代码:
$cvalue = do_shortcode( $cvalue );
eval( '$cvalue="\n<div class=\"advcustomvalue\">\n' . $cvalue . '\n</div>\n";' );
echo urldecode( stripslashes( $cvalue ) );
if ( $posttext ) {
echo $posttext;
}
}
如何解决评估代码中的语法错误(第3行)?
谢谢,
乔纳森
不要像从未使用过eval一样,尤其是如果您想做一些琐碎的事情作为连接字符串时,请不要使用。
只需执行以下操作:
$cvalue = sprintf("\n<div class=\"advcustomvalue\">\n%s\n</div>\n", $cvalue);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句