What is a common issue when trying to count occurrences of a specific string in an array using PHP?

When trying to count occurrences of a specific string in an array using PHP, a common issue is that the `array_count_values()` function only counts exact matches of the string. If the string has additional whitespace or is in a different case, it may not be counted correctly. To solve this, you can normalize the strings in the array by trimming whitespace and converting them to lowercase before counting.

// Array of strings
$array = ["apple", "Banana", "apple ", "banana", "APPLE", "orange"];

// Normalize strings by trimming whitespace and converting to lowercase
$array = array_map('strtolower', array_map('trim', $array));

// Count occurrences of a specific string (e.g., "apple")
$count = array_count_values($array)["apple"];

echo $count; // Output: 3