Created
October 31, 2011 09:57
-
-
Save kamekoopa/1327211 to your computer and use it in GitHub Desktop.
環境に依存しない文字列のバイト数取得関数
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* 環境に依存しない文字列のバイト数取得関数 | |
*/ | |
function getByteCount($str){ | |
return strlen(bin2hex($str)) / 2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment