preg_replace to remove some unwanted divs

Posted by Jason on Stack Overflow See other posts from Stack Overflow or by Jason
Published on 2011-01-17T02:45:50Z Indexed on 2011/01/17 2:53 UTC
Read the original article Hit count: 263

Filed under:
|
|

Hi All,

In the following code, I need to remove . They will always be at the start and finish of my string, for example:

<div class="grid_8"><img src="http://rps.sanscode.com/site/assets/media/images/rps_mini_logo.png" border="0" alt="Rapid Print Solutions" style="margin-bottom: 30px;" /> 
<h1></h1> 
</div>

What is a suitable regex for preg_replace to remove it? 8 can be any number between 1 and 16.

Thanks

Jason

© Stack Overflow or respective owner

Related posts about php

Related posts about regex