This is called the ternary operator, it is available in most modern programming languages. It is just a shorthand way of doing an IF THEN ELSE branch. A true/false condition comes first, followed by the ? character with one expression and then a second expression after the : character. If the condition evaluates true then the first expression gets performed (or returned, if you are assigning the ternary operator's result to a variable as in your example), if it evaluates false then the second expression gets evaluated.
Quite a few modern languages allow you to nest ternary operators. JavaScript does, but my PHP is a bit rusty at the moment, I'm not 100% sure if it does, but probably. This means you can place additional ternary operator sequences in the expressions following the ? and/or : characters. Doing this to great depth is a wonderful way to create bugs that are almost impossible to find.