If you know the array will only contain 4 or 5 values, and you need to do a specific action depending on which of the values are null, then you should use if sentences.
For example:
if (empty($types[0])) do whatever
etc
If you know the array will only contain 4 or 5 values, and you need to do a specific action depending on which of the values are null, then you should use if sentences.
For example:
if (empty($types[0])) do whatever
etc