Hello, how to insert a condition in a variable? I tried to do so
$per = "<div> ". if (1 == 1) { ."Удачно". } else { ."Не удачно". } ." </div>"; ". if (1 == 1) { ."Удачно". } else { ."Не уд...">
Hello, how to insert a condition in a variable? I tried to do so
$per = "<div> ". if (1 == 1) { ."Удачно". } else { ."Не удачно". } ." </div>"; Use the ternary operator:
$per = "<div>\n" . (1 === 1 ? "Удачно" : "Не удачно") . "\n</div>"; Удачно with HTML pictures. And that's all. - user207618$post[$photo] . - user207618($_GET[id] == $iduser) OR ($type == $iduser) OR ($iduser == $idUserp) - Sasha Osipov $per1 = "Неудачно"; if (1 == 1) { $per1 = ."Удачно". } $per = "<div>".$per1."</div>"; or
$per = "<div>".((1 == 1)? "Удачно" : "Неудачно")."</div>"; Source: https://ru.stackoverflow.com/questions/556091/
All Articles