Create directory tree (list) from routes - PHP

0

I have to deliver a project tomorrow and I came up with a last minute thing, after making a query to MySQL I get several routes:

/Fotos

/Fotos/Viajes

/Fotos/Viajes/Madrid

/Fotos/Viajes/Barcelona

Each route is a row in the database, for each record I make a explode() and I convert it into an array, but there I get blocked and I do not know how to continue.

Having this data arrived from different MySQL records, I would need to generate a list with sublevels so that it is as follows:

<li>Fotos
  <ul>
    <li>Viajes
      <ul>
        <li>Madrid</li>
        <li>Barcelona</li>
      </ul>
    </li>
  </ul>
</li>

Thanks to everyone

    
asked by Fabián Moreno 21.06.2018 в 19:39
source

0 answers