mardi 23 octobre 2018

menu displaying .> when I use a loop for displaying the menu

I'm using a loop to display my menu and I want to include icons and logo instead of just letters. When I use normal character in the array, it works but when I include the icons and logo, I get this:

menu. This is the code I use:

<?php
    $logo = "<img src=\"../res/images/logoWhite.png\" alt=\"Home\" height=\"30\">";
    $login = "<img src=\"../res/icons/png/173-user.png\" height=\"20\" alt=\"Log in/Sign Up\">";
    $cart = "<img src=\"../res/icons/png/004-shopping-bag.png\" alt=\"Cart\" height=\"20\">";
    $navs = array(0 => $logo, ' why eta? ', 'plans ', 'tutorials ', 'en', 'fr', $cart, $login);
    foreach ($navs as $nav)
        echo "<a href=\"index.php?id=$nav\">" . strtoupper($nav) . "</a>";
    $currentPage = isset($_GET['id']) ? $_GET['id'] : 'home';
?>

Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire