As you probably know, you can output PHP inside of html like so.
But what about big scripts where you'll have to continuously open PHP in different areas? This could make a mess, so lets echo out HTML INSIDE of php!PHP Code:
<html>
<title> Html and php! </title>
<body>
<?php
$Blah = true ? "blah is true" : "blah is false" ;
?>
</body>
<?php
include ("footer.php");
?>
</html>
<?php
May not look like a huge difference here, but trust me, in the long run, it will make a big difference!PHP Code:
echo' <html>
<title> Html and php! </title>
<body>';
$Blah = true ? "blah is true" : "blah is false" ;
include ("footer.php");
echo'</body></html>';
?>
Results 1 to 5 of 5
Threaded View
- 16 Dec. 2010 06:37pm #1
Output html inside of PHP makes life easier!
Last edited by HTML; 17 Dec. 2010 at 01:29am.