Table of contents Home page
$x = 'water'; echo "The string '$x' has a length of " . strlen($x) . " bytes.\n"; // Note that strlen() may have been re-defined as an alias of mb_strlen() by setting the value of mbstring.func_overload // in php.ini, in which case it will return the number of CHARACTERS instead of the number of BYTES. // If that is the case and you want to know the number of bytes, use mb_strlen() instead with 'ascii' as its second // argument.