我在PHP.i新手有一個字符串,如:
$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這些有限的詞。但我該怎麼做呢?
只是爲了確保您希望它輸出整個字符串的前15-20個字? –
是的,我想顯示字符串的前15個字 – Dev
http://stackoverflow.com/questions/10137819/split-a-string-php搜索之前,你問! – 2012-08-29 11:19:21