If you use a lot of comparison statements in your scripts, this can greatly reduce the number of lines of code. It is a conditional operator that helps in checking some conditions and doing the job accordingly. In this tutorial you will learn php ternary operator tutorial in Hindi, Urdu.You can learn what is php ternary operator in hindi and how to use this conditional ternary operator in php. : is often referred to as Elvis operator. Hey gang, in this PHP tutorial I'll show you how to use the ternary operator. We'll see how it can be used, with test-driven development and refactoring, to simplify code like: We'll see how it can be used, with test-driven development and refactoring, to simplify code like: We dig into the proper formatting later on. PHP Assignment Operators The PHP assignment operators are used with numeric values to write a value to a variable. Pada tutorial ini, kita akan belajar tentang operator dalam PHP. It is called the ternary operator because it takes three operands - a condition, a result for true, and a result for false. : expr3 returns expr1 if expr1 evaluates to TRUE, and expr3 otherwise. The ternary operator help to variable assignments based on a condition.It is a conditional operator to set the variable value.The order of execution for this operator is from left to right. It is possible to leave out the middle part of the ternary operator. The ternary operator is one way of writing condition statements in PHP. PHP shorthand conditionals helps to write less and do more. Elvis operator : ternary operator shorthand The ternary operator lets your code use the value of one expression or another, based on whether the condition is true or false: