<ul class="c2">
<li><a href="hire-project-manager/">Hire Project Manager </a></li>
<li><a href="hire-ios-developer/"> Hire iPhone Developer </a></li>
<li><a href="hire-ios-developer/"> Hire iPad Developer </a></li>
<li><a href="hire-android-developer/">Hire Android Developer </a></li>
</li>
<li><a href="hire-3d-artist/">Hire 3D Artist</a></li>
</ul>
</div>
<h1>Get In Touch With Us</h1>
<div class="copyright-footer">Copyright © All rights reserved </div>
I have following of these html and i want to remove extra spaces and need result something like:
<ul class="c2">
<li><a href="hire-project-manager/">Hire Project Manager</a></li>
<li><a href="hire-ios-developer/">Hire iPhone Developer</a></li>
<li><a href="hire-ios-developer/">Hire iPad Developer</a></li>
<li><a href="hire-android-developer/">Hire Android Developer</a></li>
</li>
<li><a href="hire-3d-artist/">Hire 3D Artist</a></li>
</ul>
</div>
<h1>Get In Touch With Us</h1>
<div class="copyright-footer">Copyright © All rights reserved</div>
Can anyone help me to solve this with the help of PHP and preg, str_replace etc