Since this is a stylistic change, and not looking to reorder the DOM for semantic reasons, I think a PHPthe js solution for this wouldwouldn't be the best way to do it since it happens before the user receives the siteapproach. Don't love the js solution since it would haveBetter to runkeep it in the browser as soon as the user receives the siteCSS, but it is still good since you are actually modifying the DOM tokeeping the correct ordermarkup intact.
Since I can't think of a PHP way of doingTwo ways to do it, and somebody already gave you a js solution, here are two CSS solutions:
Flexbox:
#generalinfo{
display: flex;
flex-direction: column-reverse;
}
CSS Grid:
#generalinfo{
display: grid;
}
.cat{
grid-row: 2;
}
Either should do the trick. Although you might have to play around with it a little more if you plan to allow the user to add more sections to the menu that must work the same way.