[FX.php List] PHP Question

Kevin Futter kfutter at sbc.melb.catholic.edu.au
Thu Jul 20 16:51:04 MDT 2006


On 21/7/06 3:25 AM, "Bob Patin" <bob at patin.com> wrote:

> I don't know why I never thought to use ECHO rather than to move in and out of
> PHP code... !
> 
> This is much more elegant; I'll definitely store this away for future use...
> 
> 
That¹s an interesting comment Bob. I tend to go the other way ­ I try as
hard as I can to separate data processing logic from both structural and
presentational layers. I¹ll put all parsing logic at the top of a page,
above any HTML code, and try to only drop into PHP when I need to print db
data or other logic-based tasks. For example, if I¹m not using PHP to write
any variables into an element on a page, then (unless I¹m using a loop to
write out a table) I won¹t use PHP to do it.

For my money...

<table>
<?php
// code to write out table rows and cells
?>
</table>

...is cleaner, more elegant and easier to read than needlessly getting PHP
to write out HTML elements.

-- 
Kevin Futter
Webmaster, St. Bernard's College
http://www.sbc.melb.catholic.edu.au/



------------------------------------------
This e-mail and any attachments may be confidential.  You must not disclose or use the information in this e-mail if you are not the intended recipient.  If you have received this e-mail in error, please notify us immediately and delete the e-mail and all copies.  The College does not guarantee that this e-mail is virus or error free.  The attached files are provided and may only be used on the basis that the user assumes all responsibility for any loss, damage or consequence resulting directly or indirectly from the use of the attached files, whether caused by the negligence of the sender or not.  The content and opinions in this e-mail are not necessarily those of the College.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iviking.org/pipermail/fx.php_list/attachments/20060721/90113281/attachment.html


More information about the FX.php_List mailing list