开发者

regex in php for finding words

i want code for the following example....

example....

$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 gain开发者_StackOverflowed considerable popularity, both 
    domestically and internationally.";

just i searched the words are "design some grand park"

i need first thirty words from the search word. like google search result page.....

thanks


You may interest Sphinx API, if you want to do like real search engines.


use preg_match_all , the last parameter gives you the result depending upon the pattern provided. You can provide a constant string instead of a regex pattern!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜