Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: Explain the ternary conditional operator in PHP?
Answer: Expression preceding the ? is evaluated, if it's true, then the expression preceding the : is executed, otherwise, the expression following : is executed.
E.g $id = isset($_GET['id']) ? $_GET['id'] : false;
Is it helpful? Yes No

Most helpful rated by users:

©2025 WithoutBook