  
                     <?php 
                     include('head.php');
if (!empty($_SESSION['cart'])) {

      $arr=count($_SESSION['cart']);
}
else {
    $arr="0" ;
}

?>
<i class="fa fa-shopping-cart" aria-hidden="true"></i> <span class="bg-danger p-2"><?php echo $arr ?></span>