Shorthand If else condition

( condition ) ? TRUE : FALSE ;

2 Responses

your short way:

$a=($b>5)?TRUE:FALSE;

this is the shortest way:

$a=($b>5);

greetings.
**Ternary operator

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.