可能重复:
拆分字符串 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 only.than 我该怎么做?