DEV Community

Discussion on: How to write a different PHP?

Collapse
 
karimboudjema profile image
Karim Boudjema

Don't forget you can also assign values in the assignment part:
$type = ($age >= 18) ? 'adult' : 'no adult';
is the same as
($age >= 18) ? $type = 'adult' : $type = 'no adult';