Help! What about this method to separate HTML code from PHP code?
| From: | jianking | Date: | Sat, 24 Aug 2002 09:41:38 +0000 |
| Subject: | Help! What about this method to separate HTML code from PHP code? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-113918@lists.php.net to get a copy of this message | ||
Help! What about this method to separate HTML code from PHP code?
I don't like the HTML code in the PHP code. So I put them in a file.
For example:
<====the old file====>
<---index.php--->
<?
echo "<html>";
echo "<body>";
echo "This is a example file!";
echo "</body>";
echo "</html>";
?>
<====method====>
I put the HTML code into a file, and use it by "include" or "require".
<---index.html.php--->
<html>
<body>
This is a example file!
</body>
</html>
<---index.php--->
<?
include "index.html.php";
?>
Can you tell me this method is good?
If not, please tell me the best method!
Thank you!!!