This is what I am trying to do. I would like my code to return the following:
"The volume of the small box is: 300"
But I cannot seem to figure out what to do:
<?php
$box = array(
"Small box" => array("length" => 12, "width" => 10, "depth" => 2.5),
"Medium box" => array("length" => 30, "width" => 20, "depth" => 4),
"Large box" => array("length" => 60, "width" => 40, "depth" => 11.5)
);
foreach ($box as $number => $boxes)
{
echo "The volume of the "."$number"." is: \t";
foreach ($boxes as $value)
{
if (is_numeric($value))
{
$sum = array_product($boxes);
echo "$sum";
}
}
echo "<br />";
}
?>