What potential pitfalls should be avoided when using string length functions in PHP?

When using string length functions in PHP, it is important to remember that these functions may return unexpected results when dealing with multibyte characters. To avoid potential pitfalls, it is recommended to use multibyte-safe functions like `mb_strlen()` instead of `strlen()` when working with multibyte strings.

$string = "こんにちは"; // Japanese greeting with 5 characters but 15 bytes in UTF-8
$length = mb_strlen($string, 'UTF-8');
echo $length; // Output: 5