如何从php中的文本中提取单词?
或者,我有这个字符串:
this is a long text string where it is written something
我想获得:
this
is
long
text
string
where
it
is written
something
答案 0 :(得分:2)
答案 1 :(得分:0)
您可以尝试内置函数explode
$string='this is a long text string where it is written something';
$output = explode(" ", $string);
var_dump($output);
它会显示您所需的结果