
|
 |

Making your HTML readable when using PHPIf you're using PHP to output HTML (common with dynamic websites), your HTML can become quite unreadable if all your code is on a single line. When echoing a line of output, be sure to slap a line break \r\n at the end of the line so your HTML is broken up into separate lines. Eg -
echo "<img src='pic.gif'><br>\r\n";
|
Comments
Comment by David Dorward on 2004-04-22
Or leave PHP when you don't really need to be using it:
?>
<img src="pic.gif" alt="The alt attribute has been required since 1996"><br>
<?php
|
Or use heredoc syntax (which lets you use variables inside it):
print <<<EOF
<img src="pic.gif" alt="The alt attribute has been required since 1996"><br>
EOF;
|
Comment by Ruben Ayala on 2007-07-27
Thanks for your help...
|
|
|