Explain the ternary conditional operator in php?



Explain the ternary conditional operator in php?..

Answer / Tarun Kumar Singh

The ternary conditional operator in PHP is a shorthand way to write an if-else statement. It has the syntax of condition ? expression_if_true : expression_if_false; For example, $result = ($x > 10) ? 'greater than 10' : 'less than or equal to 10';

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More PHP Interview Questions

What is Joomla?

5 Answers   T3 Softwares, Zend,


What are the functions used in php?

1 Answers  


What are the 5 types of data?

1 Answers  


Which are the best start and end tags to use?

1 Answers  


How many escape sequences are recognized in double-quoted strings in php?

1 Answers  


What are the variables in php?

1 Answers  


What are the difference between overloading and overriding in oops?

1 Answers  


What is slim framework?

1 Answers  


What is the difference between characters 34 and x34?

1 Answers  


What are getters and setters php?

1 Answers  


How can we submit form without a submit button?

1 Answers  


Is php an api?

1 Answers  


Categories