" . $cleanValue . "
"; $keyOrigin = substr_replace($key, "", -1); //echo "KeyOrigin = " . $keyOrigin . "
"; $pattern = '/\w+\s+/'; preg_match_all($pattern, $cleanValue, $Words); foreach($Words[0] as $key => $value) if(strlen($value) < 4) unset($Words[0][$key]); $Words = array_unique($Words[0]); if($keyOrigin == "title") $allTitles[$i] = $Words; if($keyOrigin == "phrases") $allSnippets[$i] = $Words; $i++; } foreach($allTitles as $value) { foreach($value as $word) { $titleWords[$word] += 1; } } arsort($titleWords); foreach($allSnippets as $value) { foreach($value as $word) { $snippetWords[$word] += 1; } } arsort($snippetWords); ?>
Numero de titulos com a palavra
foreach($titleWords as $key => $value) { if($value < 2) break; echo $key . ": $value " . ""; } ?>
Numero de snippets com a palavra
foreach($snippetWords as $key => $value) { if($value < 2) break; echo $key . ": $value " . ""; } ?>
"; print_r($titleWords); print_r($allTitles); print_r($allSnippets); echo ""; exit; echo "
"; print_r($_POST); echo ""; ?>