$max_length) { return substr($string,0,strrpos(substr($string,0,$max_length),' ')).$indicator; } else { return $string; } } ?>