PHP and HTML to display results

I would like to know if this is the best way to mix HTML and PHP for getting the results of from a checkbox list. Is there a better way to present the data?
After the check for array_key_exists(), I believe I would check to see if it is false to stop the code from executing anything more.


<?php

if(array_key_exists('submit',$_POST)){




}



?>

```html

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;style type="text/css"&gt;

#total
{
background-color:#FFFFCC;
border:thin #000000 solid;
width:500px;
}



&lt;/style&gt;


&lt;/head&gt;
&lt;body&gt;
&lt;div id="total"&gt;

<?php echo ''; echo ''; foreach($_POST['price'] as $value){ echo ''; echo ''; echo ''; $grandTotal= $total + $grandTotal; } echo '
You have picked the following programs:
'; switch($value){ case "summer": echo "$134.00 for 20 hours of tutoring per month"; echo '
'; echo "Your subject is ".$_POST['subject']; $total = 134.00; break; case "person": echo "Live in Person tutoring - $40.00 per hour"; $total = 40.00; break; case "online": echo "Live Online Tutoring - $12.00 per hour"; $total = 12.00; break; case "five_hours": echo "$37.00 a week for 5 hours"; $total = 37.00; break; case "two_days": echo "$22.00 a week for 2 days per week - 2 hours of tutoring per week"; $total = 22.00; break; case "three_days": echo "$30.00 a week for 3 days per week - 3 hours of tutoring per week"; $total = 30.00; break; default: echo "no selection"; } echo '
'; echo '
'; setlocale(LC_MONETARY, "en_US"); echo money_format("The price is %i", $grandTotal); ?>

&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;


Hi rlowe711
you can also use html and php this way.


<?PHP
$value="this is just a test";
//do all this above or somewhere else to keep them neet
$HTML = <<< EOF
<html codes....>
<table><whatever>$value</whatever></table>
</html codes>
EOF;
echo $HTML;
?>