I'm developing an application in php and I want to determine if a certain word will receive the letter "a" or the letter "o".
I was doing with if
and elseif
, but I do not know why it is not working.
I will put an example that I did to demonstrate my problem, this is not the code of my application, but it is an example that explains my problem well.
$type = "";
$texto1 = "carr";
$texto2 = "cas";
if($texto1){
$type = "o";
}elseif($texto2){
$type = "a";
}
echo $texto1.$type . '<br>';
echo $texto1.$type;