【发布时间】:2011-07-11 04:35:05
【问题描述】:
我想从一个字符串中提取随机子字符串,我该怎么做?
假设我有这个文本
$text = "Some totally random text I have, and I want to work on it! But need
some php skillz...";
因此我想要一个带有提取子字符串的数组
$random_string[0] = "random text I have";
$random_string[1] = "I have, and I want to work";
$random_string[2] = "need some php skillz...";
【问题讨论】:
-
你的意思是你对何时或如何制作子字符串没有任何条件??
-
感谢您的评论,一个条件是在空白处截断,因此脚本不会在中间截断单词。