FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Embedding HTML Within a PHP Statement
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Embedding HTML Within a PHP Statement [message #175991 is a reply to message #175983] Mon, 14 November 2011 13:07 Go to previous messageGo to previous message
Balazs Nadasdi is currently offline  Balazs Nadasdi
Messages: 7
Registered: November 2011
Karma:
Junior Member
On Monday, November 14, 2011 11:10:15 AM UTC+1, Erwin Moller wrote:
> Have you never seen constructs like these before?
> <table>
> <tbody>
> <?php
> foreach ($someDBResult as $oneRow){
> ?>
> <tr>
> <td>
> <?php echo $oneRow["firstName"]; ?>
> </td>
> <td>
> <?php echo $oneRow["initials"]; ?>
> </td>
> </tr>
> <?php
> }
> ?>
> </tbody>
> </table>

more readable (i don't like this: <?php } ?>):

<table>
<tbody>
<?php foreach ($someDBResult as $oneRow): ?>
<tr>
<td>
<?=$oneRow["firstName"]; ?>
</td>
<td>
<?=$oneRow["initials"]; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Smart File Downloader - simple script on xampp
Next Topic: Prevent unlink(...) warning
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 10 17:00:16 GMT 2024

Total time taken to generate the page: 0.04298 seconds