PHPverse 2025

Voting

: three minus one?
(Example: nine)

The Note You're Voting On

Anonymous
19 years ago
get the string octet-size, when mbstring.func_overload is set to 2 :

<?php
function str_sizeof($string) {
return
count(preg_split("`.`", $string)) - 1 ;
}
?>

answering to peter albertsson, once you got your data octet-size, you can access each octet with something
$string[0] ... $string[$size-1], since the [ operator doesn't complies with multibytes strings.

<< Back to user notes page

To Top