Please use the PHP option when posting data.
I am assuming that your $spe array contains the variables assigned below. In a for loop it is best to use pre-assigned values instead of a function that check the size every time. When you want to add on to the end of a string use [.=]. Finally if you need this to print the variables in reverse then count down in the for loop [for( $i = $count-1; $i >= 0; $i-- )]
<?php
$spe = Array("Ant", "Ana", "Acr");
$d = "";
$count = sizeof($spe)-1;
for($i=0; $i <= $count; $i++)
{
$d .= " sp='{$spe[$i]}'";
if ($i < $count) {
$d .= " OR ";
}
}
echo $d;
?>