What does ? … : … do? [duplicate]
This question already has an answer here: What are the PHP operators “?” and “:” called and what do they do? 9 answers $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 the new array session overwrites the old session array completely blank spaces and all. I only want to overwrite places in the