-1
I’m developing a php application and 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 don’t know why it’s 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 well my problem.
$type = "";
$texto1 = "carr";
$texto2 = "cas";
if($texto1){
$type = "o";
}elseif($texto2){
$type = "a";
}
echo $texto1.$type . '<br>';
echo $texto1.$type;
if ($texto1)
, what you hope to verify with this?– Woss
ola, vc cannot use $texto1 as boolean condition, you would have to do something like this: if($texto1 == "Carr") string comparing string int comparing int
– Furlan