Natural Words Combination From Phrase/String – php script
September 14th, 2008
2 comments
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; ...
Categories: Bookmarks, Idei, PhP, Tech multi-dimensional arrays, Natural Word, php string script, php word script, Word Combination php








