You are getting the word "Array" in the string because you are doing concatenation or "string building" inside the function, which is not allowed with arrays as parameters. Instead, build your substitution array like this
$arre = Array(
'the' => '<A HREF=\"the.html\">the</A>',
'keep' => '<A HREF=\"keep.html\">keep</A>'
);
and then your substitution like this:
$phrase = str_replace($temp2, $temp1, $phrase);