0

如何从php中的文本中提取单词?或者例如,我有这个字符串: this is a long text string where it is written something

我想获得:

this
is
long
text
string
where
it 
is written
something
4

2 回答 2

2

看看 PHP 手册explode

http://php.net/manual/en/function.explode.php

按空间爆炸' '会得到你想要的结果。

于 2012-06-06T03:04:31.220 回答
0

你可以试试内置函数explode

$string='this is a long text string where it is written something';
$output = explode(" ", $string);
var_dump($output);

它将显示您所需的结果

于 2012-06-06T03:34:52.133 回答