I'm pulling data from a dozen different text fields into a single multidimensional array, but I would like for a key to only be created if there are elements to add to it. Example:
$colors = array(
'red' => $options['red_users'],
'orange' => $options['orange_users'],
'green' => $options['green_users']
);
Let's say there is no data in the 'orange_users' input field. Other than running a conditional check on each variable, e.g...
if (!$options['orange_users']) {
...how can I efficiently validate that data exists for each input field I'm pulling from?