What does ? … : … do? [duplicate]
问题 This question already has answers here : What are the PHP operators “?” and “:” called and what do they do? (9 answers) Closed 2 years ago . $items = (isset($_POST['items'])) ? $_POST['items'] : array(); I don't understand the last snippet of this code " ? $_POST['items'] : array(); " What does that combination of code do exactly? I use it to take in a bunch of values from html text boxes and store it into a session array. But the problem is, if I attempt to resubmit the data in text boxes