Q:

Include Functions PHP

I have a Php file for include functions and a css page. I am trying to make a include function to generate most of my html. I just can not figure out how to get the css file to be in the php include function I made. 
<?phpe
    function HTMLStart( $Title)
    {
        echo "<!DOCTYPE html>\n";
        echo "<html>\n";
        echo "<head>\n";
        echo "      <title>".$Title."</title>\n";
        echo "      <link href=\ 'IncLab.css' type=\"text/css\" rel=\"Stylesheet\" />\n";
        echo "</head>\n";
        echo "<body>\n";
    }
?>

The problem I have is with the echo line:
echo "      <link href=\ 'IncLab.css' type=\"text/css\" rel=\"Stylesheet\" />\n";

I tried to use double quotes and get an error, so I tried to use single quotes for the "IncLab.css and got no error. I was wounding if this is the right way to do it. 
Also, I made a navigation bar in my include file but how to I put in a class (For CSS) to get my links to line up correctly. 
<?php
    function PageNagivation()
    {
        echo "<!-- Nav of the page --> \n";
        echo "<nav> \n";
        echo       '<div class="nav-item float-left"> <a href="IncLabPage1.php">Page 1</a>';
        echo       '<div class="nav-item end-float"> <a href="IncLabPage2.php">Page 2</a>';
        echo "</nav> \n";
    }
?>

The navigation bar works and display but does not display correctly. The problem i know lies with the <div class.... part of the code. How would i get it to work. Thanks. 

A:

For the quote problem, yes it is perfectly acceptable to use single quotes in that situation, that's what they are for. You were escaping one of them, which you don't need to do:
echo "<link href='IncLab.css' type='text/css' rel='Stylesheet' />\n";

For adding the class, you can just input it into the HTML like:
echo '<div class="nav-item end-float myclass"> <a href="IncLabPage2.php">Page 2</a>';

Or, if it is stored in a variable:
echo '<div class="nav-item end-float '.$myclass.'"> <a href="IncLabPage2.php">Page 2</a>';

Or
echo '<div class="nav-item end-float $myclass"> <a href="IncLabPage2.php">Page 2</a>';

A:

Change the quotes like this - 
echo "      <link href='IncLab.css' type='text/css' rel='Stylesheet' />\n";

You should do this with all of the HTML you're echoing to keep your code clean and troubleshooting simplified.

