Well, what Strider64 was saying is that when values are posted to a form, null fields (not empty ones) are not even posted, therefore there is no need to check for empty ones. To explain a little further, a input field can be several things data-wise.
NOT-SET ( Means the field was never accessed and does not exist. )
NULL ( Means the field is 100% empty and never had anything in it. )
EMPTY ( Means the field is set but has nothing inside it. )
DATA ( Means the field actively contains data. )
If you post a form using the if (($_SERVER[‘REQUEST_METHOD’] === ‘POST’) check, it means that the user submitted the form. This means that there might be live data or not. ALL live data, if present, would be inside the $_POST[ ] array. You could save that if needed. But, it does not tell you if individual fields were entered or not. There fore you need to check for these things:
If each value ISSET because if a field started empty and the user did not change it, then it would never exist in the $_POST[ ] array. You check it with " if isset($_POST[‘some-field-name’]) ".
If a field is set, meaning it does exist, you need to check it to see if it is empty. To do that you check it with " if !empty($_POST[‘some-field-name’]) ".
Therefore you need to use both of these for testing each field. But, back to your question…
If you want to combine your posted multiswitch’s id and adet, are both of these inside the $_POST array? You could do it the same way you last posted. But, one problem with this, you combine “id” and “adet” into a combined array, but, this does not create a valid index for it. How would you know what the “multiswitch” array index be? That index would not tell you want is stored in the combined array. It would make more sense to save the combined array as the index. But, yes, you can combine posted data into an array as you posted. I would suggest that in your database, you store it as three entries. The “multiswitch” as the index and two fields for the two arrays of data, id’s and adet’s. Makes your life easier. Just deal with the data, not attempting to combine the into one field.