 <nav aria-label="Page navigation example">
          <ul class="pagination">
            <li class="page-item">
              <a class="btn btn-outline-dark btn-sm mr-1" href="lista-de-cursos.php?pagina=0" aria-label="Previous">
                <span aria-hidden="true">&laquo;</span>
                <span class="sr-only">Previous</span>
              </a>
            </li>
            <?php 
            for($i=0;$i<$num_paginas;$i++){
            $estilo = "";
            if($pagina >= ($i - 2) and $pagina <= ($i + 2)){
            if($pagina == $i)
              $estilo = "active";
            ?>
             <li class="page-item"><a class="btn btn-outline-dark btn-sm  mr-1 <?php echo $estilo; ?>" href="lista-de-cursos.php?pagina=<?php echo $i; ?>"><?php echo $i+1; ?></a></li>
          <?php } } ?>
            
            <li class="page-item">
              <a class="btn btn-outline-dark btn-sm " href="lista-de-cursos.php?pagina=<?php echo $num_paginas-2; ?>" aria-label="Next">
                <span aria-hidden="true">&raquo;</span>
                <span class="sr-only">Next</span>
              </a>
            </li>
          </ul>
        </nav>