php - What's isset($_POST[''])?_POST['']:false -
what isset($_post['usrnm'])?$_post['usrnm']:false; do? better thanisset($_post['usrnm']) {} ?
it ternary operator. translates to:
if (isset($_post['usrnm'])) $username = $_post['usrnm'] else $username = false; the above code or below one:
isset($_post['usrnm'])?$_post['usrnm']:false; - checks if
$_post['usrnm']variable has been set (can set form throughpost). - if set,
$usernamevalue set. else, setfalse.
second question
isset($_post['usrnm']) {} the above code looks syntax error.
Comments
Post a Comment