[Solved] Undefined index (PHP)


It’s ternary. The syntax is var = (true) ? trueValue : falseValue; It’s the same as this:

if  ( empty($_POST['code']) ) {
    $code =  null;
} else {
    $code = $_POST['code'];
}

solved Undefined index (PHP)