
Untitled
By: a guest on
May 1st, 2012 | syntax:
None | size: 1.34 KB | hits: 11 | expires: Never
What's the difference between enclosing and not enclosing HTML within PHP? [closed]
<?php
$test = array('a','b','c');
if (isset($test))
{
echo '<div id="testmessage">
<h2>
Test Message Below
</h2>
<ul>';
foreach ($test as $t)
{
echo '<li>'.$t.'</li>';
}
echo '</ul>';
echo '</div>';
}
?>
<?php $test = array('a','b','c');
if (isset($test)){
?>
<div id="testmessage">
<h2>
Test Message Below
</h2>
<ul>
<?php
foreach ($test as $t)
{
?>
<li><?php echo $t; ?></li>
<?php
}
?>
</ul>
</div>
<?php
}
?>
<?php
$test = array('a','b','c');
if (isset($test)): ?>
<div id="testmessage">
<h2>
Test Message Below
</h2>
<ul>
<?php foreach ($test as $t): ?>
<li><?php echo $t; ?></li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
<?php
$test = array('a','b','c');
if (isset($test)){
echo('<div id="testmessage">');
echo('<h2>Test Message Below</h2>');
echo('<ul>');
foreach ($test as $t) {echo '<li>'.$t.'</li>';}
echo('</ul>');
echo('</div>');
}
?>