php - Strip Tags short div -


hello have lot of div tags, want delete div tag of characters in little div tag.number of string <10 ex

$txt=<<<html  <div class="abc"> 123ab</div> <div id="abc"> 123ab</div>   <div class="abc"> 123abcdfdfsdfsdfdsfsdfsdfdsf</div> html; 

and return dig(include long string)

$txt=<<<html     <div class="abc"> 123abcdfdfsdfsdfdsfsdfsdfdsf</div> html; 

preg_replace('#<div(?:[^>]*)>.{0,10}</div>#u','',$txt) 

not tested


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -