NB moji limit - Documentation

Installation

Copy the pi.nb_moji_limit.php file in your /plugins folder.

For ExpressionEngine 2:

Copy the nb_moji_limit folder to your /system/expressionengine/third_party folder.

Important note

This addon uses multibyte capabilities of PHP, namely mb_strlen and mb_substr functions. Make sure these functions are available on your installation of PHP, or the addon may not work as it should.

Usage

{exp:nb_moji_limit limit="10"}

あいうえおかきくけこさしすせそ

{/exp:nb_moji_limit}

...will give

あいうえおかきくけこ...

Parameters

limit="10"

Limits the number of multibyte characters (eg. 10 kana/kanji characters). Default is 50 characters.

encoding="SJIS"

Sets the character encoding. Default is UTF-8.

tail="---"

Adds characters at the end of the truncated string. Default is "..." (non-multibyte). Set to tail="" to add nothing to the end of the string.

Creative Commons License