I have got a problem creating an array.
I have 3 arrays with words in them.
I read those words and compare them with eachother to set the final number of words and give them a score.
I do this with a couple of loops and set new a variable which should become a new array.
This new array (word_combi) contains the word, the number of times is was in the total list and the score.
I have got the code I use below (which doesn't work)...can anyone tell me my error and point out the way to fix this?
Thx.
<?
// set variables
$title_array = $arrayoftitle;
$keyword_array = $arrayofkeywords;
$word_array = $arrayofwords;
// compare words
$loop = true;
$loop1 = true;
$t=0;
for ($t; $t<count($word_array) and $words_words = each($word_array);$t++)
{
if ($loop)
{
for($tt=0;$tt<$tbk and $words_key = each($keyword_array); $tt++)
{
if ($loop1)
{
for($ttt=0;$ttt<$tbt and $words_title = each($title_array); $ttt++)
{
if ($words_words[ "key" ]=== $words_key[ "key" ])
{
if ($words_key[ "key" ] === $words_title[ "key" ])
{
$word_combi[$t][0] = $words_words[ "key" ];
$word_combi[$t][1] = ($words_title[ "value" ])+($words_key[ "value" ])+($words_words[ "value" ]);
$word_combi[$t][2] = ((0.5*(pow(1.05,$words_title[ "value" ])))*(0.75*(pow(1.1,$words_key[ "value" ])))*(0.9*(pow(0.9,$words_words[ "value" ]))));
}
}
}
}
$loop1 = true;
if ($title_array!="")
{
reset($title_array);
}
}
}
$loop = true;
if ($keyword_array!="")
{
reset($keyword_array);
}
}
?>