I have an array of arrays that get populated when a form is submitted.
$groceries = array(
"Veggies" => array(
"Cabbage, ear(s)" => $_POST['cabbageQTY'],
"Carrots, bag(s)" => $_POST['carrotQTY'],
"Tomatoes, vine(s)" => $_POST['tomatoeQTY']
),
"Meats" => array(
"Ground Beef, lb(s)" => $_POST['groundBeefQTY'],
"Steak, lb(s)" => $_POST['steakQTY'],
"Pork, lb(s)" => $_POST['porkQTY']
),
"Desserts" => array(
"Ice Cream, gallon(s)" => $_POST['iceCreamQTY'],
"Jello, box(es)" => $_POST['jelloQTY'],
"Pie, box(es)" => $_POST['pieQTY']
)
);
If all the fields come up null, is there a way to check to see if the values will be empty?
I read somewhere else you can try and do this.
!array_filter($groceries)
But I think this would work for a 1 dimentional array. Anyway to do this in a 2d array? If you guys could tell me how to do this, it would be awesome
Thank you in advance.