What are some common pitfalls to avoid when working with string lengths in PHP?

One common pitfall when working with string lengths in PHP is forgetting to account for multi-byte characters, which can lead to incorrect string length calculations. To avoid this issue, always use `mb_strlen()` function instead of `strlen()` when dealing with multi-byte characters.

// Incorrect way of getting string length
$string = "こんにちは";
$length = strlen($string); // This will return 15 instead of 5

// Correct way of getting string length with multi-byte character support
$length = mb_strlen($string); // This will return 5