tags:

views:

43

answers:

1

Hello I have a lot of div tags, but I want to delete the div tag of characters in that 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 only dig(include long string)

$txt=<<<HTML
    <div class="abc"> 123abcdfdfsdfsdfdsfsdfsdfdsf</div>
HTML;
+2  A: 
preg_replace('#<div(?:[^>]*)>.{0,10}</div>#u','',$txt)

not tested

MatTheCat
Don't work.:(.Can You help me
Thoman
Sorry i just edit ^^'
MatTheCat
Great Thanks MattheCat
Thoman