<?php $html = '<ul class="foo"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul>'; $newHtml = preg_replace("/(?<=<li>)(.*)(?=<\/li>)/", '<svg class="icon"><use xlink:href="#foo"></use></svg>$1', $html); echo $newHtml;
You have javascript disabled. You will not be able to edit any code.