I want to display a user’s firstname if they gave us one, otherwise their email.
The code below functions, but I don’t like how it takes so many lines, I vaguely recall some way of maybe doing this with OR?
I have (essentially):
if ($firstname == "")
{
$name = $email;
}else{
$name = $firstname;
}
echo $name;
The shorter version (PHP 5)