我想要以下示例的代码...
示例...
$words = "The sculpture was selected during a design competition. After
Kapoor's design was chosen, numerous technological concerns regarding
the design's construction and assembly arose, in addition to concerns
regarding the sculpture's upkeep and maintenance. Various experts were
consulted, some of whom believed the design could not be implemented.
Eventually, a feasible method was found, but the sculpture's construction
fell behind schedule. It was unveiled in an incomplete form during the
Millennium Park grand opening celebration in 2004, before being concealed
again while it was completed. Cloud Gate was formally dedicated on
May 15, 2006, and has since gained considerable popularity, both
domestically and internationally.";我刚才搜索的词是“设计一些宏伟的公园”
我需要搜索单词中的前30个单词。就像谷歌搜索结果页面.....
谢谢
发布于 2010-03-01 17:26:12
如果你想像真正的搜索引擎一样,你可能会对Sphinx API感兴趣。
发布于 2010-03-01 17:16:13
使用preg_match_all,最后一个参数根据提供的模式给出结果。您可以提供常量字符串而不是正则表达式模式!
https://stackoverflow.com/questions/2354744
复制相似问题