Archive

Posts Tagged ‘multi-dimensional arrays’

Natural Words Combination From Phrase/String – php script

September 14th, 2008 2 comments
Natural Words Combination From Phrase/String – php script Get all natural word combination from phrase: <?php function natural_combi_words($phrase) { $arw = array(); $words = explode(' ',trim($phrase)); $nw = count ($words); for ($i=0; $i<$nw; $i++) { $k =''; $cnt = 0; for ($j=$i; $j<($nw); $j++) { $k .= $words[$j].' '; $arw[$cnt][] = trim($k); $cnt++; } } return $arw; } function natural_combi_words2($phrase) { $combi_source = natural_combi_words($phrase); $combi_words = $combi_source[0]; $nw = count ($combi_source); for ($i=1; ...
GoCache - ByREV-Cache v1.0 - live served in : 0.409678 sec (gzip)