$array_words
is an array which has every 'single' word from a file in it.
$array_2_words = implode(" ", $array_words);
$array_2_words = preg_replace("/[^A-Z0-9-\' ]/i", "", $array_2_words);
$array_2_words = str_replace(" ","",$array_2_words);
$jk = explode(" ",$array_2_words);
$i = sizeof($jk);
$j = 0;
$array_2_words="";
for($j=0;$j<$i-1;$j++)
{
$array_2_words[] = $jk[$j]." ".$jk[$j+1];
}
I know what the result of this code is, making an array with 2 words each.
For example: It will make from a sentence like this: This is a test sentence
the following array:
This is
is a
a test
test sentence
But would someone be so kind to comment (each|some) line(s) to how it exactly does this from an array with 1 word in every entry to 2 words like my example.
I could just leave this code in my script but I will only fool myself by not knowing how it works.
Thanks in advance!