I've done some research, here is a way that you could do it:
$array = array(0 => 'blue', 1 => 'reds', 2 => 'green', 3 => 'reds');
//Words to be searched from.
$res = array("percent" => "0", "word" => "N/A");
//Result, this is an array for the bellow loop to talk to.
foreach($array AS $ar){
similar_text("red", $ar, $percent);
//If it's more like the word, then replace the percentage with the percentage of similarity & word.
if($percent > $res["percent"]){
$res["percent"] = $percent;
$res["word"] = $ar;
}
}
//Echo out the most similar word.
echo $res["word"];
From what I could find, this was the only way possible for doing something like this.