Function Reference: geodir_utf8_strimwidth

Summary

Get truncated string with specified width.

Package

Geodirectory

Parameters

$str
(string) (required) The string being decoded.

Default: None
$start
(int) (required) The start position offset. Number of characters from the beginning of string. For negative value, number of characters from the end of the string.

Default: None
$width
(int) (required) The width of the desired trim. Negative widths count from the end of the string.

Default: None
$trimmaker
(string) (required) A string that is added to the end of string when string is truncated. Ex: “. “.

Default: None
$encoding
(string) (required) The encoding parameter is the character encoding.

Default: “UTF-8”

Return Values

(string)

    Change Log

    Since: 1.6.18

    Source File

    geodir_utf8_strimwidth() is located in geodirectory-functions/helper_functions.php [Line: 1096]

    Source Code

    function geodir_utf8_strimwidth( $str, $start, $width, $trimmaker = '', $encoding = 'UTF-8' ) {
        if ( function_exists( 'mb_strimwidth' ) ) {
            return mb_strimwidth( $str, $start, $width, $trimmaker, $encoding );
        }
        
        return geodir_utf8_substr( $str, $start, $width, $encoding ) . $trimmaker;
    }