sözcükleri bulmak için php regex

2 Cevap php

i aşağıdaki örnek kod istiyorum ....

örnek ....

$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.";

sadece ben kelimeleri "Bazı büyük parkı tasarım" vardır arandı

i arama kelimesinden ilk otuz kelime gerekir. google arama sonucu sayfası gibi .....

teşekkürler

2 Cevap

Gerçek arama motorları gibi yapmak istiyorsanız, Sphinx API ilgi olabilir.

preg_match_all kullanmak, son parametre sağlanan desen bağlı size sonuç verir. Sen sabit bir dize yerine bir regex desen sağlayabilir!