--- Steve Keller <[EMAIL PROTECTED]> wrote:
> Here's a good tip someone gave me when I first started
> learning PHP: when you're dealing with HTML, it's a good
> idea to use \n at the end of your echoed lines and \t's
> at the beginnings to create staggered indentations,
> this makes it a little easier to read when you're
> testing the output.

Proper HTML formatting is a great suggestion. Many novices
write broken tables, simply because their markup is too
sloppy for them to notice their errors.

Aside from using \n and \t in your echo statements,
consider that you can also switch in/out of PHP mode as
appropriate. In many cases, there is very little (or no)
dymanic data in your output, so it may be better just to
write it in HTML. For example, consider this in lieu of
your code snippet:

else
{
?>
      <td align="center" width="15%">Hello</td>
<?
   $i++;
}

instead of:

else {
        echo "<td align=\"center\" valign=\"middle\" width=\"15%\"

height=\"77\" border=\"1\" bordercolor=\"#000000\">";
        echo "<div align=\"center\"><font
size=\"1\"></font></div>";
        echo "Hello" ; $i++;
} //for else

Not only is this much easier to read, it also would have
helped you notice the missing </td> tag that Steve pointed
out for you.

Chris

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to