PHP Adding a Line Break
Posted: Sun Mar 06, 2011 11:12 am
Hello,
This is how my PHP code is written:
and Here is the source code of my HTML:
It appears as 1 line, I want each <lI> to appear in a new line.
Any suggestions?
Thank you.
This is how my PHP code is written:
Code: Select all
echo '<li'; if($page == "index.html") echo ' class="selected"'; echo '><a href="' .HOME_URL. '">Home</a></li>';
echo '<li'; if($page == "about.html") echo ' class="selected"'; echo '><a href="' .ABOUT_URL. '">About</a></li>';
echo '<li'; if($page == "portfolio.html") echo ' class="selected"'; echo '><a href="' .PORTFOLIO_URL. '">Portfolio</a></li>';
echo '<li'; if($page == "contact.php") echo ' class="selected"'; echo '><a href="' .CONTACT_URL. '">Contact</a></li>';
Code: Select all
<li><a href="home">Home</a></li><li><a href="about">About</a></li><li><a href="portfolio">Portfolio</a></li><li><a href="contact">Contact</a></li>Any suggestions?
Thank you.