dongqiongjiong4740 2017-06-30 12:11 采纳率: 0%
浏览 47

如何捕获以#标签开头的子串?

I'm looking for php code to split word from text using regex, preg_match() , preg_split(), or any other way.

$textstring="one #two three #four #five";

I need to get #two,#four, and #five saved as array elements.

  • 写回答

3条回答 默认 最新

  • douan3019 2017-06-30 12:16
    关注

    Try splitting by this: \b #

    preg_split("/\\b #/", $text)
    
    评论

报告相同问题?