Re: echo statements
| From: | Curt Zirzow | Date: | Sat, 19 Jul 2003 00:36:18 +0000 |
| Subject: | Re: echo statements | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-155857@lists.php.net to get a copy of this message | ||
Jay Fitzgerald <jayfitz@bayou.com> wrote:
> When echoing html code that will include variables from a while or if loop,
> which method is best?
> Method 1: echo "<td align=\"left\" VALIGN=\"top\"><font
> class=\"dbtables\">$employer</font></td>";
> OR
> Method 2: <td align="left" valign="top"><font
> class="dbtables"><?php echo
> "$employer"; ?></font></td>
method 2a:
<td class="dbtables"><?php echo $employer?></td>
> If you would, please give reasons why to support your opinion.
> Thanks
>
- readability
- less typing
- easier to type no \" or if using ' and " together when to use one or
the other... etc etc etc....
- code is easier to read
- never use the font tag.. bad.. evil...
Curt
--