WordPress.org

Ready to get started?Download WordPress

Forums

Wizzart - Recent Comments
too small support UTF-8 and cyrilic (2 posts)

  1. Den999
    Inactive
    Posted 3 years ago #

    Hi!
    do not use "substr" in PHP. otherwise, the Russian language can cut incorrectly and in the end gets a "question mark", like this:

    в режиме онла�...

    this: �����

  2. Den999
    Inactive
    Posted 3 years ago #

    may be this exampes can help you to understand:

    function maxsite_str_word($text, $counttext = 10, $sep = ' ') {
    	$words = split($sep, $text);
    	if ( count($words) > $counttext )
    		$text = join($sep, array_slice($words, 0, $counttext));
    	return $text;
    }

    [Please post code snippets between backticks or use the code button.]

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic