-2
<?php if (!empty(cutstr($node->content,300))) : ?>
<div class="pr_teaser">
<?php echo cutstr($node->content,300); ?>
</div>
<?php endif; ?>
代码有什么问题? cutstr
功能没问题。我的IDE对此行提醒<?php if (!empty(cutstr($node->content,300))) : ?>
是错误的?但我找不到错误。代码有什么问题?
是什么让你觉得有什么错呢? (即,你期望输出什么,你会得到什么输出?) – Quentin 2011-04-11 08:22:54
绝对错误的是你没有使用'htmlspecialchars()'来转义输出。 – Tomalak 2011-04-11 08:25:29
阅读文档有助于:http://php.net/manual/en/function.empty.php。请注意该笔记。 – 2011-04-11 08:26:50