BBCode::Internal_LimitText( $string, $limit )
Description
Source
File: bp-forums/admin/parser.php
1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 | function Internal_LimitText( $string , $limit ) { $chunks = preg_split( "/([\\x00-\\x20]+)/" , $string , -1, PREG_SPLIT_DELIM_CAPTURE); $output = "" ; foreach ( $chunks as $chunk ) { if ( strlen ( $output ) + strlen ( $chunk ) > $limit ) break ; $output .= $chunk ; } $output = rtrim( $output ); return $output ; } |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.