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
Post a Comment