Jag glömmer alltid hur man skriver en kort if-sats i PHP. För att jag ska slippa Googla på detta i framtiden lägger jag nu upp ett exempel.
$catfood = ($taste == "good") ? "the catfood is good" : "the catfood tastes like shit";
Praktiskt användbart exempel:
$text = "There ". ($total == 1 ? "is 1 cat" : "are ".($total == 0 ? "no cats" : "$total cats") );