Last active
January 2, 2017 02:22
-
-
Save incubs/5fcf3c21cafb717f0746c9342c100276 to your computer and use it in GitHub Desktop.
usingforeach
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if (isset($_POST)) { ?> | |
<div class="container"> | |
<table class="table-condensed table-hover table-bordered" > | |
<tr> | |
<?php | |
if(!empty($_POST)) | |
{ | |
foreach ($_POST as $tablehead => $value) { | |
?> | |
<th> <?php | |
echo $tablehead; | |
?> | |
</th> | |
<?php } | |
} | |
?> | |
</tr> | |
<tr> | |
<?php | |
if(!empty($_POST)) | |
{ | |
foreach ($_POST as $tablehead => $value) | |
{ | |
?> | |
<td><?php if (!empty($value)) | |
{ | |
if (is_array($value)) { | |
foreach ($value as $item) { | |
echo $item; | |
} | |
} else { | |
echo $value; | |
} | |
}?></php></td> | |
<?php | |
} | |
} | |
?> | |
</tr> | |
</table> | |
</div> | |
<?php }?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment