$parole = array('prova','penna','libro','acqua','stella','cane','pioggia');
echo implode(',',solo_doppie($parole)); //output: penna,stella,pioggia
function solo_doppie($p){
$return = array();
foreach($p as $pr){
$pr = str_split($pr);
foreach($pr as $k=>$c){
if($k==0) continue;
if($c==$pr[--$k]) $return[] = implode($pr);
}
}
return $return;
}