Shorthand Comparisons using Ternary Operators in PHPby@cveasey

Shorthand Comparisons using Ternary Operators in PHP

tldt arrow
Read on Terminal Reader
Read this story w/o Javascript

Too Long; Didn't Read

This article is aimed at beginners or anyone who may be unaware of what a Ternary Operator is. I’ve encountered a few peers who seemed completely unaware that these things exist! Ternary Comparisons are very situational but can make your code a bit more readable if used in the right situation. For the uninitiated a ternary operator looks like the following:

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Shorthand Comparisons using Ternary Operators in PHP
Clint Veasey HackerNoon profile picture

@cveasey

Clint Veasey

From stacking tents for the airforce to working as a full stack developer.


Receive Stories from @cveasey

react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!