私はphp Querypathを使用しており、htmlの上下にあるすべての空のタグをhtml文字列から削除しようとしています。例えば:
<div> </div>
<div> </div>
<div>I want remove empty div tag on top and bottom</div>
<div> </div>
<div>other content</div>
<div> </div>
<div> </div>
php querypath を使用すると、次のように変更できます。
<div>I want remove empty div tag on top and bottom</div>
<div> </div>
<div>other content</div>
どのようにできるのか?