hmmm...this may work...dunno, havent really tested it.
function new_wordwrap($var,$limit,$delimiter){
$x=0;
while(strlen($var)>$limit){
#we know that this line needs to be split
$temp=substr($var,0,$limit);
$temp2=explode($delimiter,$temp);
$newline[$x]=substr($temp,0,($limit-strlen($temp2[count($temp2)])));
$var=substr($var,strlen($newline[$x]));
$x++;
}
return $newline;
}
it takes in the string, the max length of a segment, and what character you want to break on before the end of each line. returns an array
ICK--this doesnt work...give me a few to try again