I am learning arrays in PHP and would like to know how to do something like extracting and calculating items in a multidimensional array, for a small receipt exercise I am attempting:
$products = array('Textbook' => array('price' => 35.99, 'tax' => 0.08),
'Notebook' => array('price' => 5.99, 'tax' => 0.08),
'Snack' => array('price' => 0.99, 'tax' => 0)
);
My trouble is finding out how to list the items separately in order to print or calculate (for example, multiplying an item by it's sales tax), to display as a receipt. I know my HTML and CSS, I know how to do basic calculations within PHP, but looping through a multidimensional array has gotten me stuck. Thank you very much for any tips.