I am trying to convert an existing check for a file to use a ternary operator instead. My original check is this...
if (isset($_FILES["file"])) {
echo '7';
};
This works correctly, my version using ternary operator looks like this...
isset($_FILES['file']) ? $_FILES['file'] : 7;
I get the error message...
Undefined index: file
Why is this happening, where am I going wrong?