The benefit of this is that you can do all kinds of logic and manipulation of data, and then send some formatted HTML to the browser for display the results.
.phtml and .php are the same thing though you really don't see .phtml too much anymore. On the server side, you can configure the extension to use for php.
"A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools."
-- Douglas Adams
if you want to have lines of php in your webpages that do specific things when the page is loaded by the server before sending to the client then you need to have the .php file extension (.phtml is probably safe to say deprecated now) and you need to wrap your code inside of the below tags
<?php ...codehere... ?>
teh important part is to make sure you have the <?php at the start and the ?> at the end otherwise the server wont recognise it and you will serve your code as part of the webpage. hope that helps.
Last edited by damndaewoo; 05-20-2012 at 11:22 PM.
Reason: because ... I forget...