I'm pretty new to web development and I am trying to learn by trying to develop a website of course. However, I am hitting an issue, I don't get why my include function in PHP is not working.
My 'menu.php' file contains:
<?php
echo '
<li><a href="#" class="current">Home</a></li>
<li><a href="#">button1</a></li>
<li><a href="#">button2</a></li>
<li><a href="#">button3</a></li>
<li><a href="#">button4</a></li>
<li><a href="#">button5</a></li> ';
?>
My html file contains the following:
...
<nav>
<ul>
<?php include 'menu.php'; ?>
</ul>
</nav>
...
What am I missing? If I copy the list items from my .php to my .html, it works properly. It works:
...
<nav>
<ul>
<li><a href="#" class="current">Home</a></li>
<li><a href="#">button1</a></li>
<li><a href="#">button2</a></li>
<li><a href="#">button3</a></li>
<li><a href="#">button4</a></li>
<li><a href="#">button5</a></li>
</ul>
</nav>
...
Thank you in advance.