What potential pitfalls should be aware of when using the substr_count() function in PHP?

One potential pitfall when using the substr_count() function in PHP is that it is case-sensitive. This means that if you are looking for a substring in a string, it will only count exact matches with the same case. To overcome this limitation, you can use the strtolower() function to convert both the string and the substring to lowercase before counting.

$string = "Hello World";
$substring = "hello";
$count = substr_count(strtolower($string), strtolower($substring));
echo $count; // Output: 1