Re[2]: [PHP-I18N] String length

From: Date: Thu, 25 Mar 2004 14:27:17 +0000
Subject: Re[2]: [PHP-I18N] String length
References: 1 2  Groups: php.i18n 
Request: Send a blank email to php-i18n+get-677@lists.php.net to get a copy of this message
Hi, On Monday, February 9, 2004, 9:25:47 PM, Moriyoshi Koizumi: MK> You can use mb_orig_strlen() where the byte-wise behaviour is MK> needed, when strlen() is overloaded by mb_strlen(). The same applies to MK> other mbstring counterparts (e.g. substr() - mb_substr() - mb_orig_substr()). MK> This is an undocumented feature though. MK> BTW, while it's found useful sometimes, it's also discouraged to use MK> function overloading as strlen() is the only reasonable way to MK> retrieve the length of a binary object in bytes at this time. I MK> couldn't assure this, but sizeof() / count() will likely replace MK> that functionality of strlen() and strlen() will probably be used MK> solely to get the actual character count. I know about undocumented feature - mb_orig_* functions. And I know that count()/sizeof() returns the number elements in array, for all other types it returns 1. I suggest adding a function, which returns the length of a binary object in bytes, in MB String module to use that function with filesystem, network and other functions which handle binary data.

« previous php.i18n (#677) next »