2
Hello, all right?
PHP can take tabs-formatted text and turn it into a ul?
José
Dados
Idade: 30
Estado Civil: Solteiro
Hobbies
Tocar violão
Rock
Blues
Ler
Viajem
Praia
And I’d like to turn to look like this:
<ul>
<li>José
<ul>
<li>Dados
<ul>
<li>Idade: 30</li>
<li>Estado Civil: Solteiro</li>
</ul>
</li>
<li>Hobbies
<ul>
<li>Tocar violão
<ul>
<li>Rock</li>
<li>Blues</li>
</ul>
</li>
<li>Ler</li>
<li>Viajem
<ul>
<li>Praia</li>
<li>Montanha</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
Where does this text come from?
– Sam
From a client, now I don’t know how he does these texts, there is some way to search for tabs, for example, a preg_replace that analyzes if he has a tab, he does a routine, two tabs does another and so on
– Alê Moraes
Take a look at my answer. I was able to identify the tab.
– Andrei Coelho
I tended to use REGEX but could not. Maybe @dvd can.
– Andrei Coelho
@Andreicoelho It seems to me that your answer killed the question.
– Sam