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.
我正在尝试使用 preg_split 拆分此文本
Yes, it was great. [I have no ideas how great it was.]
进入这个数组:
['Yes', 'it', 'was', great', '[I have no ideas how great it was.]'
但是我不知道怎么...
$keywords = preg_split("/[\s,.]+(?![^[]*])/", "Yes, it was great. [I have no ideas how great it was.]"); print_r($keywords);