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

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

PostgreSQL 9.x - pg_read_binary_file & inserting files into bytea -

asp.net - call stack missing info on mono with apache and mod_mono -