';}
echo '';
//representation of the player token, depending on the ID
if($values[$i]==1){
echo 'X';
}else if($values[$i]==-1){
echo 'O';
}else{
//If noone put a token on this, and if noone won, make a link to allow player X to
//put its token here. Otherwise, empty space.
if($winstate==0){
$values_link = $values;
$values_link[$i]=1;
echo ' ';
}else{
echo ' ';
}
}
echo ' | ';
//end of a row
if(fmod($i,3)==2){echo '';}
}
?>
Player '.(($winstate==1)?'X':'O').' won!';
}
?>