Limiter



( ZN >= 1.0.0 )

Used to restrict words or characters in the text.

 

 

# Methods


String word ( String $ str , Int $ limit = 100 , String $ endChar = '...' )
String char ( String $ str , Int $ limit = 500 , String $ endChar = '...' )

 

 

# Word ( ZN> = 4.0.1-EIP )


The amount of words to be limited in the input text is determined.

Parameters

String $ data Data to be applied to the limit operation.
Int $ limit = 100 The amount of words to limit.
String $ endChar = '...' The expression to be added at the end of the string obtained as a result of the limit operation.
Bool $ stripTag = true Do you convert html characters?
String $ encoding = 'utf8' The character encoding of the string.
return String

uses

\Output::writeLine( Limiter::word("Welcome to ZN", 2) );
\Output::writeLine( Limiter::word("Welcome to ZN", 3, '+++') );
Welcome ...
Welcome to +++ 

 

 

# Char ( ZN >= 4.0.1-EIP )

The amount of characters to be limited in the input text is determined.

Parameters

String $ data Data to be applied to the limit operation.
Int $ limit = 500 The amount of characters to be limited.
String $ endChar = '...' The expression to be added at the end of the string obtained as a result of the limit operation.
Bool $ stripTag = true Do you convert html characters?
String $ encoding = 'utf8' The character encoding of the string.
return String

uses

\Output::writeLine( Limiter::char("Welcome to ZN", 7) );
\Output::writeLine( Limiter::char("Welcome to ZN", 10, '+++') );
Welcome ...
Welcome to +++