Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
PHP
$age = 20; print ($age >= 18) ? "Adult" : "Not Adult";
Johnny Jacob van Vliet
Programming language:
PHP
2021-05-18 22:33:36
-1
Q:
$age = 20; print ($age >= 18) ? "Adult" : "Not Adult";
Amir
Code:
PHP
2021-05-19 23:21:04
// ternary operator (?:) $age = 20; print ($age >= 18) ? "Adult" : "Not Adult";
1
Tags
int
age
print
New to Communities?
Join the community