Level 74
That is good enough. You might consider using numeric values that references the like or dislike though. It will take up less pace in the database.
Summer Sale! All accounts are 50% off this week.
$type equals "Like" or "Dislike" I want the counterpart.
// This works just fine but I feel like there's a sexier way...
$counterpart = ($type == "Like") ? 'Dislike' : 'Like';
This will work as well
$counterpart = ['Like', 'Dislike'][$type === 'Like'];
and in your example parentheses are not required
$counterpart = $type == 'Like' ? 'Dislike' : 'Like';
Please or to participate in this conversation.