I have a variable which consists of diffrent html tags:
$html = '<h1>Title</h1><u>Header</u><h2>Sub Title</h2><p>content</p><u>Footer</u>'
I want to find all the u tags in the $html variable and give them the id of their contents.
It should return:
$html = '<h1>Title</h1><u id="header" >Header</u><h2>Sub Title</h2><p>content</p><u id="footer" >Footer</u>'