function format_title($title,$max=64) {

        if (core_text::strlen($title) <= $max) {
            return $title;
        } else {
            return core_text::substr($title, 0, $max - 3) . '...';
        }
    }
function format_title($title,$max=64) {

        if (core_text::strlen($title) <= $max) {
            return $title;
        } else {
            return core_text::substr($title, 0, $max - 3) . '...';
        }
    }
function format_title ( $ title , $ max = 64 ) { if ( core_text :: strlen ( $ title ) <= $ max ) { return $ title ; } else { return core_text :: substr ( $ title , 0 , $ max - 3 ) . '...' ; } }
Strips a large title to size and adds ... if title too long
This function does not escape HTML entities, so they have to be escaped
before being passed here.

@param string title to shorten
@param int max character length of title
@return string title shortened if necessary
Strips a large title to size and adds ... if title too long This function does not escape HTML entities so they have to be escaped before being passed here .