我要爲下面的示例代碼....正則表達式在PHP查找單詞
例如....
$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個單詞。像谷歌搜索結果頁面.....
感謝
因此,你想在「設計」,「一些」,「大」或「公園」的任何一個*之後獲取'$ words'中的前30個單詞?所以你想要「設計比賽。選擇卡普爾的設計之後[剪輯23個單詞]」? – 2010-03-01 09:17:33