CoreFiles by mySites.guru
strlen.php35 lines, 1,087 bytes, from Joomla_1.5.2-Stable-Full_Package.zip
Raw History Compare with 1.5.1
md5
7342cbcc14f1138874ef1184b5de171c
sha1
ccc40e603a07e080aa3d3aa72d5869de1719548e
sha256
4e1258fbcb407b039f264baa9a329386d5a02942f977ab2f727d350b9b86484c
<?php
/**
* @version $Id: strlen.php 7692 2007-06-08 20:41:29Z tcp $
* @package utf8
* @subpackage strings
*/

/**
* Define UTF8_STRLEN as required
*/
if ( !defined('UTF8_STRLEN') ) {
    define('UTF8_STRLEN',TRUE);
}

//--------------------------------------------------------------------
/**
* Unicode aware replacement for strlen(). Returns the number
* of characters in the string (not the number of bytes), replacing
* multibyte characters with a single byte equivalent
* utf8_decode() converts characters that are not in ISO-8859-1
* to '?', which, for the purpose of counting, is alright - It's
* much faster than iconv_strlen
* Note: this function does not count bad UTF-8 bytes in the string
* - these are simply ignored
* @author <chernyshevsky at hotmail dot com>
* @link   http://www.php.net/manual/en/function.strlen.php
* @link   http://www.php.net/manual/en/function.utf8-decode.php
* @param string UTF-8 string
* @return int number of UTF-8 characters in string
* @package utf8
* @subpackage strings
*/
function utf8_strlen($str){
    return strlen(utf8_decode($str));
}

The same content is in 4 releases, Joomla 1.5.0 to 1.5.3. See them all, or every version of this file.