使用php代码刷新<li>

I have this code:

<li class="dropdown">
    <a class="dropdown-toggle" data-toggle="dropdown" href="#" title="Alerts">
        <i class="fa fa-bell fa-2x" aria-hidden="true"></i><?php number_of_alerts($emailOfTheLoggedInUser); ?><br/><br/>
        <span class="caret"></span>
    </a>
    <ul class="dropdown-menu">
        <li><?php echo alerts($emailOfTheLoggedInUser); ?></li>
    </ul>
</li>

I need to refresh functions number_of_alerts($emailOfTheLoggedInUser) and alerts($emailOfTheLoggedInUser)every 5 seconds, this functions makes a query to mysql database and bring back a number and a description of the alert, I already try with several suggestions but anything works. Your help will really be appreciated.

You should use jQuery.ajax() or something similar to make server calls to your php pages that run alerts($emailOfTheLoggedInUser); and number_of_alerts($emailOfTheLoggedInUser); functions.

`<?php number_of_alerts($emailOfTheLoggedInUser); ?>` 

The above function is php code and php is server side scripting language. If you want to reload this function after specific time period then you have to reload the whole web page. To reload the web page after 5 second the code is written below.

<head>
<meta http-equiv="refresh" content="5">
</head>

Put this code in head section of page.