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;
echo ($firstname) ? $firstname : $email;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With