From the data returned by a query, I would like to generate an xml, but without saving it to the file and traversing the xml tags to treat the data in some way. I would like to know how to pass the xml to foreach without having this xml in file.
Suppose the generated xml is:
<disciplinas>
<disciplina id="1">
<periodo>1</periodo>
<nome>matematica</nome>
</disciplina>
<disciplina id="id_disciplina">
<periodo>1</periodo>
<nome>portugues</nome>
</disciplina>
<disciplina id="2">
<periodo>1</periodo>
<nome></nome>
</disciplina>
<disciplina id="3">
<periodo>2</periodo>
<nome>historia</nome>
</disciplina>
</disciplinas>
With xml, I want to check the data to generate a table with rowspan where the values of the "period" are repeated
insteadofatablewithoutrowspan.