What does this code mean?

Another query concerning code because this stuff is just a pain to search for via search engine.

$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'login';

I think the ‘?’ means OR but mostly I’m just guessing what it does. Can someone let me know please?

Hy,
That code is the same with:


if(isset($_REQUEST['action'])) {
  $action = $_REQUEST['action'];
}
else {
  $action = 'login';
}

Ah, figured it was something like that. Thanks Marplo.

See Ternary Operator
PHP: Comparison Operators - Manual

Thanks logic.