php - 如何在php中显示有限的单词

这个问题在这里已经有了答案:
关闭 10 年前

Possible Duplicate:
split a string PHP

我是 PHP 的新手。我有一个像这样的字符串:

$string="Once the Flash message has been set, I redirect the user to the form or a list of results. That is needed in order to get the flash working (you cannot just load the view in this case… well, you can but this method will not work in such case). When comparing $result TRUE or FALSE, please notice the different value for type. I am using type=message for successful messages, and type=error for error mesages.";

现在我只想显示 15 或 20 之类的有限单词。我该怎么做呢?

相关文章:

sql - UNION ALL 之后的 CTE

css - 带 float 的无序列表项 :left do not float properly

php - 如何使用 SimpleXML 解析忽略错误的 XML

php - 使用 maxlength 标签通过 PHP 检查表单输入长度

ruby-on-rails - 在 Rails 3 的邮件拦截器中设置 header

sql - SQL Server 中的窗口函数

php - 将 PDF 存储在 MySQL 数据库中

ruby-on-rails - RAILS3 : to_JSON with multiple obj

c# - 从字符串中删除无法识别的 ASCII 字符

bash - 获取 n 个最后记录并更改它们的特定列