What do you think of my function. It is used to change a cyrillic word with a stress marker into the same cyrillic word but with the stress marker seperately represented as a number. As I want to return two values I pass two parameters by reference. I assume there is at most only one stress marker per word. Be critical. What could I improve here. I just want to see what people think.
function seperateStress($word,&$cleanWord,&$stressLetter){
$stressLetter=-1;
$cleanWord="";
for($i=0;$i<strlen($word);$i++){
if($word[$i]=="&" ){
//echo $i."</br>";
$stressLetter=$i;
$i=$i+5;
}else{
$cleanWord .=$word[$i];
//echo $word[$i].":".$i."</br>";
}
}
//return array($cleansedWord,$stressedLetter);
}
//Sample Test run
$stressWord= "велосипе́ды";
$noStressWord="";
$stressLetter=-1;
seperateStress($stressWord,$noStressWord,$stressLetter);
echo $noStressWord."::".$stressLetter."</br>";