Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何从php中的文本中提取单词?或者例如,我有这个字符串: this is a long text string where it is written something
this is a long text string where it is written something
我想获得:
this is long text string where it is written something
看看 PHP 手册explode
explode
http://php.net/manual/en/function.explode.php
按空间爆炸' '会得到你想要的结果。
' '
你可以试试内置函数explode
$string='this is a long text string where it is written something'; $output = explode(" ", $string); var_dump($output);
它将显示您所需的结果