<?php
$texto="Texto <br /> texto texto texto <br /><br /><br /><br />";
for($i=0; $i<count($partes); $i++){
if (substr($texto, -6)=="<br />"){
$texto=substr($texto, 0, ($len-6));
}
}
echo $texto;
PD9waHAKCiR0ZXh0bz0iVGV4dG8gPGJyIC8+IHRleHRvIHRleHRvIHRleHRvIDxiciAvPjxiciAvPjxiciAvPjxiciAvPiI7CgokcGFydGVzPSBleHBsb2RlKCI8YnIgLz4iLCR0ZXh0byk7Cgpmb3IoJGk9MDsgJGk8Y291bnQoJHBhcnRlcyk7ICRpKyspewoKJGxlbj1zdHJsZW4oJHRleHRvKTsKCmlmIChzdWJzdHIoJHRleHRvLCAtNik9PSI8YnIgLz4iKXsKCiR0ZXh0bz1zdWJzdHIoJHRleHRvLCAwLCAoJGxlbi02KSk7Cgp9Cgp9CgplY2hvICR0ZXh0bzsK